时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
Now we have a function f(x):
int f ( int x ) {
if ( x == 0 ) return 0;
return f ( x / 10 ) + x % 10;
}
For a given interval [A, B] (1 <= A <= B <= 10^9), calculate how many integer x that mod f(x) equal to 0.
输入描述:
The first line has one integer T (1 <= T <= 50), indicate the number of test cases.
Next T lines, Each line has one test case that has two integers A and B, separated by one blank space.
输出描述:
For each test case, output only one line containing the case number and an integer indicated the number of x.