| II Olympiad of classes at the Mechanics and Mathematics Faculty of MSU in programming 2023. |
|---|
| Finished |
Today in the math class, Sasha was told about Pascal's triangle. In this triangle, ones are placed at the top and on the sides. Each number is equal to the sum of the two numbers above it. The first six rows of the triangle look like this:
Using this rule, the triangle can be made as large as desired. Sasha wondered if the number $$$n$$$ is in this triangle and where it is located. After quickly solving the problem, Sasha rewarded himself with a chocolate. Can you solve this problem too?
The input consists of a single natural number $$$n$$$ $$$(1\le n \le 10^{6})$$$.
If the number $$$n$$$ is in the triangle, output two non-negative integers $$$x, y$$$ $$$(0 \le y \le x \le 10^{18})$$$ - the row number and the position in this row where the number $$$n$$$ is located in the triangle. It is guaranteed that these constraints are sufficient to output the answer.
If the number $$$n$$$ is not in the triangle, output a single number $$$-1$$$.
Remember that the numbering of rows starts from $$$0$$$ and the numbering of numbers in each row also starts from $$$0$$$.
If there are multiple positions with the number $$$n$$$, you can output any of them.
1
0 0
2
2 1
10
5 3
| Name |
|---|


