#d11201. GCD
GCD
GCD
Problem Description
Given integers and , count the number of integers satisfying and .
Input Format
The first line contains an integer .
The next lines each contain two integers .
Output Format
Output lines, each containing a single integer: the answer.
Sample Input
3
4 9
5 10
42 9999999967
Sample Output
6
1
9999999966
Constraints
, .