COMDIV  Number of common divisors
You will be given T (T<=10^6) pair of numbers. All you have to tell is the number of common divisors between two numbers in each pair.
Input
First line of input: T (Number of test cases)
In next T lines, each have one pair A B (0 < A, B <= 10^6)
Output
One integer describing number of common divisors between two numbers.
Example
Input: 3
100000 100000
12 24
747794 238336
Output: 36
6
2
hide comments
vritta:
20200414 11:44:13
If you r using cin or cout then paste this line in main function first "ios::sync_with_stdio(0);


shivamvermadev:
20200407 12:46:11
always use scanf and printf for IO operations in spoj questions


naman_mawandia:
20191229 20:42:46
use printf & scanf instead of cout & cin, costed me 2 TLE Last edit: 20191229 20:43:54 

mrmajumder:
20191130 06:54:04
The trick here is that, the divisors of the gcd(a, b) is the answer [Let a, b be the given pair].


rana_1234:
20191029 20:56:00
cout gave me accepted and printf gave me WA. :) 

importme:
20190928 21:42:38
My 50th on SPOJ!! 

sanket17:
20190713 06:42:47
if u r using cin and cout then copy this lines


towhid1zaman:
20190619 06:10:26
find gcd, and dont use printf 

frochbg:
20190530 20:07:31
Nice problem :) 

scolar_fuad:
20190413 15:42:27
Only a single cin and cout will cost you TLE don't need to seive just find gcd and then count divisor

Added by:  Mir Wasi Ahmed 
Date:  20101031 
Time limit:  0.600s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  Own problem, used in UODA TST 