d of the number with the decimal portrayal of integer d+1. For instance, 1912 becomes 21023 in the wake of applying the activity once. You need to find the length of n subsequent to applying m tasks. Since the appropriate response can be exceptionally
Correct answer will be upvoted else downvoted. Computer science.
single activity, you should supplant each digit d of the number with the decimal portrayal of integer d+1. For instance, 1912 becomes 21023 in the wake of applying the activity once.
You need to find the length of n subsequent to applying m tasks. Since the appropriate response can be exceptionally enormous, print it modulo 109+7.
Input
The main line contains a solitary integer t (1≤t≤2⋅105) — the number of experiments.
The main line of each experiment contains two integers n (1≤n≤109) and m (1≤m≤2⋅105) — the underlying number and the number of activities.
Output
For each experiment output the length of the subsequent number modulo 109+7.
Step by step
Solved in 3 steps with 1 images