Today is the first day of the little mouse Jerry at school. Famous mathematician Tom is his teacher. Today, Tom taught Jerry about numbers, powers, etc. After the discussion session, Tom wanted to take a test of Jerry to evaluate how much he learned.
The problem that Tom asked Jerry to solve is simple. Tom will give him two integers and . Jerry has to answer how many integer numbers in the range are there so that the condition below will hold for all and , where and are positive integers.
Jerry is clever. So he hired you to write a program to solve the problem for him.
First line of the input will contain a single integer (). denotes the number of test cases. Each of the next lines will contain two positive integers () and ().
For each case print without quotations where is the case number and is the required answer.
Input | Output |
---|---|
5 1 1 2 2 3 3 4 4 5 5 | Case 1: 1 Case 2: 1 Case 3: 2 Case 4: 2 Case 5: 4 |