Problem 761
Quotient and Remainder
Problem
Read a non-negative integer A and a positive integer B. Print the quotient and the remainder of dividing A by B: the quotient is how many whole times B fits into A, and the remainder is what is left over. They always satisfy A = quotient × B + remainder with 0 <= remainder < B. In most languages these are A / B (integer division) and A % B.
Input
A single line with two integers A and B.
Output
Print the quotient and the remainder separated by a space.
Constraints
0 <= A <= 10^9; 1 <= B <= 10^9
Example input
17 5
Example output
3 2
Explanation
For A = 17 and B = 5, 5 fits 3 whole times into 17 (15) and 2 is left over, so the answer is 3 2. Check: 3 × 5 + 2 = 17.