Hide

Problem A
Evening Out 1

Marika has two integers $A$ and $B$. She wants $A$ to be divisible by $B$. She can pay $1$ coin to increase or decrease $A$ by $1$. What is the minimum number of coins she must pay?

Input

The first and only line contains the integers $A$ and $B$ ($1 \le A, B \le 10^{18}$).

Output

Output a single line with the minimum number of coins Marika must pay.

Explanation of sample 1

In the first example, she can pay $2$ coins to increase $A$ from $58$ to $60$, which is divisible by $B = 6$.

Sample Input 1 Sample Output 1
58 6
2

Please log in to submit a solution to this problem

Log in