#P8814. [CSP-J 2022] 解密
[CSP-J 2022] 解密
Problem Description
Given a positive integer , there are queries. In each query, three positive integers are given. Find two positive integers such that and .
Input Format
The first line contains a positive integer , meaning there are queries.
The next lines each contain three positive integers on the -th line.
Output Format
Output lines. Each line contains two positive integers as the answer.
To make the output consistent, you should ensure that .
If there is no solution, output NO.
10
770 77 5
633 1 211
545 1 499
683 3 227
858 3 257
723 37 13
572 26 11
867 17 17
829 3 263
528 4 109
2 385
NO
NO
NO
11 78
3 241
2 286
NO
NO
6 88
Hint
Sample #2
See decode/decode2.in and decode/decode2.ans in the attachment.
Sample #3
See decode/decode3.in and decode/decode3.ans in the attachment.
Sample #4
See decode/decode4.in and decode/decode4.ans in the attachment.
Constraints
Let .
It is guaranteed that for of the testdata, . For any , , , and .
::cute-table{tuack}
| Test Point ID | Special Property | |||
|---|---|---|---|---|
| A solution is guaranteed. | ||||
| None. | ||||
| A solution is guaranteed. | ||||
| None. | ||||
| A solution is guaranteed. | ||||
| None. | ||||
| If a solution exists, then is guaranteed. | ||||
| A solution is guaranteed. | ||||
| None. | ||||
Translated by ChatGPT 5