提示: 欢迎访问OurACM平台。
Problem 1992 An Easy Problem

Accept: 83    Submit: 169
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Trust me, this problem is easy.

In mathematics, “MOD” operation is common. C = A (MOD B), which means that the remainder of A after divided by B is equal to that of C. It’s an easy problem to test whether A and C satisfy the condition above. But what you are expected to is not so easy! You will be given A and C and to find the number of B who satisfies the condition (equation) above, you could assume that A is not equal to C in this problem.

Input

The first line is one integer T indicates the number of the test cases. (T <= 30)

Then for every case, the first line has two integers A and C. (1 <= A, C <= 10^9, A is not equal to C)

Output

Output one line.

First output “Case idx: ”, here idx is the case number count from 1.

Then output the number of B who satisfies the condition (equation) above.

Sample Input

3 4 2 2 4 9 3

Sample Output

Case 1: 2 Case 2: 2 Case 3: 4

Source

FOJ有奖月赛-2010年12月

Submit  Back  Status  Discuss