Integer division
Operation | Description | With variables | Example with numbers |
---|---|---|---|
| Addition |
|
|
| Subtraction |
|
|
| Multiplication |
|
|
| Division |
|
|
| Floor division |
|
|
| Modulus (remainder after division) |
|
|
| Exponent |
|
|
When dealing with integers, we can do a regular division with a / b
and we can do a whole division with a // b
which would result in only the whole part after dividing a
by b
. The remainder after division a
by b
can be taken with %
.
Given two numbers in the input x
and y
. Print the result of the whole division x
by y
and the remainder after dividing x
by y
.
Input | Output |
---|---|
10 | 2 0 |
9 | 2 1 |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB