#d2498. 加一

加一

Plus One

Problem Description

You are given an integer nn. You need to perform mm operations on it. In one operation, you replace every digit dd with d+1d + 1. For example, 19121912 becomes 2102321023 after one operation.

Find the length of the number after nn has been operated on mm times. The answer may be large; output it modulo 109+710^9+7.

Input Format

The first line contains an integer tt, the number of test cases.

Each of the next tt lines contains two integers nn and mm, denoting the initial number and the number of operations.

Output Format

For each test case, output the length of the final number, modulo 109+710^9 + 7.

Sample Input

5
1912 1
5 6
999 1
88 2
12 100

Sample Output

5
2
6
4
2115

Constraints

For all data, 1≤t≤2⋅1051\leq t \leq 2\cdot 10^5, 1≤n≤1091 \leq n \leq 10^9, 1≤m≤2⋅1051\leq m \leq 2\cdot 10^5.