#P5596. 【XR-4】题
【XR-4】题
Description
X encountered a problem:
Given natural numbers , find the number of pairs of natural numbers that satisfy:
He cannot solve it, so he asks you, who are good at math, for help.
If there are infinitely many pairs of natural numbers that satisfy the condition, you only need to output inf.
Input Format
One line with two integers .
Output Format
If the number is finite, output one integer in one line, representing the count.
If the number is infinite, output one string inf in one line.
5 15
1
4 4
inf
12 6
0
96 96
7
10000 9999997
6
Hint
Sample #1 Explanation
Constraints
This problem uses bundled testdata.
- Subtask 1 (3 points): .
- Subtask 2 (6 points): , there is no case with an infinite number of solutions.
- Subtask 3 (9 points): , there is no case with an infinite number of solutions.
- Subtask 4 (13 points): , there is no case with an infinite number of solutions.
- Subtask 5 (14 points): , .
- Subtask 6 (14 points): .
- Subtask 7 (14 points): .
- Subtask 8 (27 points): no special constraints.
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号