Given a positive number N and a number D. Write a program to find the count of numbers smaller than N such that the difference between the number and sum of its digits is greater than or equal to given specific value D.

**Input:**

First line of input contains a single integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains two space separated integers N and D.

**Output:**

For each test case, print the count of numbers smaller than N such that the difference between the number and sum of its digits is greater than or equal to D.

**Constraints:**

1<=T<=100

1<=N<=10^{5}

1<=D<=10^{4}

**Example:
Input:**

2

13 2

14 3

4

5