1815 定义的函数


Submit solution

Points: 100
Time limit: 2.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

定义函数f(x)表示x的各位数字之和,比如f(1)=1, f(55)=10, f(345)=12.

现在给定常数A和区间[L, R],问你在这个区间里面有多少个数x满足f(x)f(x)=f(Ax).

Input

不超过40组数据。一组数据一行,包括三个整数A,L,R。数据范围:0<=A<100, 1<=L<=R<=1000,000,000。

Output

首先输出case数,然后是答案。

Sample

Input

1 1 10
2 1 10
88 888 8888

Output

Case 1: 2
Case 2: 1
Case 3: 0

Source: zjut_DD


Comments

There are no comments at the moment.