I I U P C 2 0 1 4 |
|
Problem B: Count LCM |
|
|
|
LCM is an abbreviation used for Least Common Multiple in Mathematics. We say LCM (a, b) = L if and only if L is the least integer which is divisible by both a and b. You will be given N, M. You have to count number of pair (i, j) such that LCM (i, j) = i × j, where 1≤i≤N and 1≤j≤M.
|
|
Input |
|
Input starts with an integer T (≤ 1000), denoting the number of test cases. Each case starts with a line containing two integers N, M (1 ≤ N, M ≤ 109, and minimum of (N, M) ≤ 106).
|
|
Output |
|
For each case, print number of such pair.
|
|
Sample Input |
Output for Sample Input |
3 1 2 4 2 3 5 |
2 6 12
|
|
|
Problem Setter: Mohammad Hafiz Uddin Alternate Solution: F. A. Rezaur Rahman Chowdhury |