#P7578. 「RdOI R2」数(number)
「RdOI R2」数(number)
Description
Find three distinct positive integers such that, for any two of them, their sum is divisible by the third number.
Now you are given several types of requirements as follows:
- Given the value of , find .
- Given the value of , find .
- Given the value of , find .
Input Format
There are lines in total.
The first line contains an integer , indicating that there are test cases.
The next lines each contain two items:
- A string, which can be , , or , indicating which two numbers were subtracted to obtain the given value.
- A number, the value of this difference.
Output Format
There are lines in total.
Each line outputs three positive integers (as described above). The problem guarantees that a solution exists.
1
x-y 1
3 2 1
Hint
Sample Explanation
From , we know that the difference between and is . After trying, we get .
It is then clear that , , and .
Constraints
- For of the testdata, i.e., Sample #1.
- For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号