Easy

13.03%

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

**Input:**

The first line of input contains an integer T denoting the number of test cases. Each test case contains two space separated integers N and k.

**Output:**

Print an integer which is the required value.

**Constraints:**

1<=T<=50

1<=N,k<=10^{9}

**Example:
Input:**

2

13 2

10 5

4

1

```
Input : N = 13, diff = 2
Output : 4
Then 10, 11, 12 and 13 satisfy the given
condition shown below,
10 – sumofdigit(10) = 9 >= 2
11 – sumofdigit(11) = 9 >= 2
12 – sumofdigit(12) = 9 >= 2
13 – sumofdigit(13) = 9 >= 2
Whereas no number from 1 to 9 satisfies
above equation so final result will be 4
```