#P2522. [HAOI2011] Problem b
[HAOI2011] Problem b
Description
For each of the given queries, count the number of pairs such that , , and . The function denotes the greatest common divisor of and .
Input Format
The first line contains an integer . Each of the next lines contains five integers, denoting .
Output Format
Output lines, each containing one integer representing the number of pairs that satisfy the conditions.
2
2 5 1 5 1
1 5 1 5 2
14
3
Hint
Constraints: For of the testdata, the following holds: , , .
Translated by ChatGPT 5
京公网安备 11011102002149号