#CCBCMCHIN0000011. Bài toán chia hết (Divisibility Problem)

Bài toán chia hết (Divisibility Problem)

Divisibility Problem

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given two positive integers aa and bb. In one move, you may increase aa by exactly 11. Find the minimum number of moves needed to make the resulting value of aa divisible by bb. The answer may be 00 if aa is already divisible by bb.

Input

A single line contains two integers aa and bb.

Output

Print one integer: the minimum number of moves needed.

Subtasks

  • Subtask 1 (20 points): 1≤a,b≤1001\le a,b\le 100.
  • Subtask 2 (30 points): 1≤a,b≤10000001\le a,b\le 1000000.
  • Subtask 3 (50 points): 1≤a,b≤10000000001\le a,b\le 1000000000.

Examples

Example 1

Input

10 4

Output

2

Explanation

For a = 10 and b = 4, the remainder a % b is 2. The minimum increment to the next multiple is 2, so the program prints 2.

Example 2

Input

92 46

Output

0

Explanation

For a = 92 and b = 46, the remainder a % b is 0. The minimum increment to the next multiple is 0, so the program prints 0.