We call a number EXcellent if it divided by euqals or it contains the number , see sample for details.
Now we want to know how many EXcellent numbers are between ?
Since this number can be very large, print the remainder when it's divided by lovely .
输入
The first line contains an integer — the number of test cases you need to solve.
The only line of each test case contains 2 integers without leading zeros.
输出
For each test case, print the result mod lovely .
样例
标准输入 复制文本 |
3 1 1 2 12 666 233 |
标准输出 复制文本 |
3 11 828654121 |
提示
In the first example, there are
In the second example, there are
来源
2021 GDCPC 广东省大学生程序设计竞赛