#P7161. [COCI 2020/2021 #2] Euklid
[COCI 2020/2021 #2] Euklid
Description
For positive integers , define as:
$\begin{cases}R(b,a)&a<b\\R\left(\left\lfloor\dfrac{a}{b}\right\rfloor,b\right)&1<b\leq a\\a&1=b\leq a\end{cases}$
Given positive integers , find positive integers such that and .
Input Format
The first line contains an integer , the number of test cases.
The next lines each contain two positive integers .
Output Format
Output lines, each containing two positive integers that satisfy the requirements.
Both and must not exceed .
It can be proven that such always exist. If there are multiple solutions, output any one of them.
1
1 4
99 23
2
3 2
5 5
9 39
5 5
Hint
Sample Explanation #1
, .
Constraints
For of the testdata, , .
Subtask #1 ( pts): .
Subtask #2 ( pts): .
Subtask #3 ( pts): .
Subtask #4 ( pts): .
Subtask #5 ( pts): .
Subtask #6 ( pts): no additional constraints.
Notes
Translated from Croatian Open Competition in Informatics 2020 ~ 2021 Round 2 C Euklid。
Translated by ChatGPT 5
京公网安备 11011102002149号