#P1712E1. LCM Sum (easy version)
LCM Sum (easy version)
No submission language available for this problem.
Description
This version of the problem differs from the next one only in the constraint on . You can make hacks only if both versions of the problem are solved.
You are given two positive integers and .
Count the number of distinct triplets of integers such that and .
Here denotes the least common multiple (LCM) of integers , , and .
Each test contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.
The only line for each test case contains two integers and (, ).
For each test case print one integer — the number of suitable triplets.
Input
Each test contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.
The only line for each test case contains two integers and (, ).
Output
For each test case print one integer — the number of suitable triplets.
Samples
Note
In the first test case, there are suitable triplets:
- ,
- ,
- .
In the second test case, there is suitable triplet:
- .