#Lutece0832. Good Numbers
Good Numbers
Migrated from Lutece 832 Good Numbers
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
If we sum up every digit of a number and the result can be exactly divided by , we say this number is a good number.
You are required to count the number of good numbers in the range from to , inclusive.
Input
The first line has a number () , indicating the number of test cases.
Each test case comes with a single line with two numbers and ().
Output
For test case , output Case #X:
first, then output the number of good numbers in a single line.
Samples
2
1 10
1 20
Case #1: 0
Case #2: 1
Note
The answer maybe very large, we recommend you to use long long instead of int.
Resources
2013 ACM-ICPC China Chengdu Provincial Programming Contest