#d11206. LCM与GCD
LCM与GCD
LCM and GCD
Problem Description
Given three positive integers , find the number of ordered pairs satisfying
$$x \times \operatorname{lcm}(a,b) - y \times \gcd(a,b) = k$$where is the least common multiple of and , and is their greatest common divisor.
If , then and are considered two different ordered pairs.
Input Format
The first line contains an integer , the number of test cases ().
Each of the next lines contains three integers as described above ().
Output Format
Output lines, each containing one integer: the number of valid ordered pairs.
Sample Input
4
1 1 3
4 2 6
3 3 7
2 7 25
Sample Output
4
3
0
8