|Contests||Virtual Contests||Problems||Submit||Runs Status||Rank List||Forum|
Given two positive integers n and m, write a program to calculate the number of commen divisors of them.
The first line of input is the single integer t, given the number of test cases. Then t lines follows, each line has two positive integers: n and m. (0 < t ≤ 1000, 0 < n, m ≤ 2147483647).
For each test cases, output an integer in a single line: the number of common divisors of the given n and m.