Common Divisor
Submissions: 2180   Accuracy:

46.29%

  Difficulty: Easy   Marks: 2

Given two numbers, p and q. Find the number of common divisors of p and q. 

Input: 

Each input consists of T,the number of test cases. Each test case consists of two integers p and q.
Output:

Output consists of a single line denoting the number of common divisiors of p and q.

Constraints:

1<=T<=100000

1<=p,q<=1000
Example:

Input:

2
2 4
3 5

Output:

2
1

** For More Input/Output Examples Use 'Expected Output' option **

Author: Priyesh Kumar


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.