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
ANKUR GARG:
20130128 12:44:03
can u give some more tricky test cases as these are working fine in my code but m still getting WA 

Darky:
20130120 11:41:52
@Arunesh Pandey: 1 

Arunesh Pandey:
20130120 09:29:50
what will be the output for 3 13 ? 

dipak yadav:
20130119 13:30:11
my id is 8535685


dipak yadav:
20130119 13:24:44
what is wrong in my code id is 8535685


Spar!k:
20130115 15:37:11
Last edit: 20130202 22:49:11 

DEVANSH PARASHAR:
20130101 20:55:09
tle


Retaliation:
20121231 20:40:41
check my solution. Why am i getting tle ? submission id :8386786 

spock:
20120621 03:37:36
finally..green light.. :P 

krishnan:
20120204 12:23:47
Atlast I got AC Last edit: 20120204 12:25:03 
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 