Problem: You are given two integers and . Calculate the number of integers such that and .
Note: is the greatest common divisor of and .
Input Format: The first line contains the single integer () — the number of test cases.
Next lines contain test cases — one per line. Each line contains two integers and ().
Output Format: Print integers — one per test case. For each test case print the number of appropriate -s.
Note: In the first test case appropriate -s are .
In the second test case the only appropriate is .