[Solution] Madoka and Strange Thoughts Codeforces Solution
Madoka is a very strange girl, and therefore she suddenly wondered how many pairs of integers exist, where , for which .
In this problem, denotes the greatest common divisor of the numbers and , and denotes the smallest common multiple of the numbers and .
The input consists of multiple test cases. The first line contains a single integer () — the number of test cases. Description of the test cases follows.
The first and the only line of each test case contains the integer ().
For each test case output a single integer — the number of pairs of integers satisfying the condition.
For there is exactly one pair of numbers — and it fits.
For , there are only pairs — , , , and they all fit.
For , all pair are suitable, except and , since their is , and is , which doesn't fit the condition.
No comments:
Post a Comment