Weirdland

View as PDF

Submit solution


Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem types

Şehmettin is the oddest person in the Weirdland who is currently living in the house X. Being the unique person he is, he wants to live in a house with a house number that is divisible by Y. But every day Şehmettin can either increase or decrease his house number by 1 according to the laws of Weirdland. Find the least number of days needed for Şehmettin to reach his goal.

Input

The only line contains 2 positive integers:

  • \(1 \leq X \leq 10^9\) (his house number)
  • \(1 \leq Y \leq 1000\) (number divisor)

Output

Print the minimum number of days needed.

Example

Input:

8 5

Output:

2

Explanation

Şehmettin's house number is \(8\). The closest multiple of \(5\) is \(10\). On the \(1\)st day, Şehmettin's house number goes up to \(9\). On the \(2\)nd day, Şehmettin's house number goes up to \(10\). It takes \(2\) days in total to reach \(10\).