~/algor $ cat problems/if-manfiy-son-qoldigi
Remainder of a negative number
Medium
1000 ms
64 MB
43%
An integer $a$ and a positive integer $b$ are given. Find the quotient $q$ and the remainder $r$ that satisfy:
$$a = b * q + r, \qquad 0 \le r \lt b$$
Input
One line with two integers: $a$ and $b$.
Output
One line with two integers: $q$ and $r$.
Note
$-10^{9} \le a \le 10^{9}$
$1 \le b \le 10^{9}$
Examples
Input #1
17 5
Output #1
3 2
Input #2
-17 5
Output #2
-4 3