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 $N$ and $M$. Jerry has to answer how many integer numbers $X$ in the range $[1,M]$ are there so that the condition below will hold for all $1 ≤ Y < X$ and $1 ≤ Z < N$, where $Y$ and $Z$ are positive integers.
$X×Z \neq Y×N$
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 $T$ ($1 ≤ T ≤ 10^6$). $T$ denotes the number of test cases. Each of the next $T$ lines will contain two positive integers $N$ ($1 ≤ N ≤ 10^6$) and $M$ ($1 ≤ M ≤ 10^{18}$).
For each case print $\texttt{Case t: v}$ without quotations where $\texttt{t}$ is the case number and $\texttt{v}$ 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 |