Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/if-manfiy-son-qoldigi

Remainder of a negative number

Medium 1000 ms 64 MB 43%
Share

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$$

The quotient and a non-negative remainder

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

Sign in to submit a solution

Signing up is free and takes a minute.