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

Author: harsh.agarwal0

Vishal Arora 1 | 580 |

KohliAbhijeet | 210 |

TYSSSantosh | 196 |

VikaSh 2 | 192 |

rohanrko | 192 |

Aditya Singh 17 | 952 |

stupid_af | 841 |

Dhaya_Mohan | 645 |

Whatever_As_If | 613 |

TYSSSantosh | 611 |

akhayrutdinov | 4717 |

Quandray | 3746 |

sanjay05 | 3668 |

Ibrahim Nash | 3664 |

surbhi_7 | 2776 |