BETA

Difficulty Level: Easy

Total Submissions: 312 Accuracy:

19.23%

Possible Pairs
       

Given GCD(a, b) is equal to G and LCM(a, b) is equal to L. The task is to find number of possible pairs (a, b).

Input:
First line consists of T test cases. Only line of test cases consists of 2 integers G and L.

Output:
Single line output, print the count of possible pairs.

Constraints:
1<=T<=100
1<=G,L<=1000

Example:
Input:

2
2 12
3 6
Output:
4
2

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

Contributor: Saksham Raj Seth

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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