#P1499D. The Number of Pairs
The Number of Pairs
No submission language available for this problem.
Description
You are given three positive (greater than zero) integers , and .
You have to find the number of pairs of positive integers such that equality holds. Where is the least common multiple of and and is the greatest common divisor of and .
The first line contains one integer () — the number of test cases.
Each test case consists of one line containing three integer , and ().
For each test case, print one integer — the number of pairs () such that the above equality holds.
Input
The first line contains one integer () — the number of test cases.
Each test case consists of one line containing three integer , and ().
Output
For each test case, print one integer — the number of pairs () such that the above equality holds.
Samples
Note
In the first example, the correct pairs are: (), (), (), ().
In the second example, the correct pairs are: (), (), ().