| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 0 | 0 | 0 | 0.000% |
For a positive integer $k$ and a positive integer $f_1,ドル a sequence $f$ is recursively generated according to the following formula for $n \geq 2$: $$f_n = k n + \left \lceil \frac{f_{n-1}}{n} \right \rceil \cdot n$$
For example, if $k = 4$ and $f_1 = 23$:
$$\begin{array}{lllrrrr} f_1 & & & & & = & 23 \\ f_2 & = & 4 \cdot 2 & + & 24 & = & 32 \\ f_3 & = & 4 \cdot 3 & + & 33 & = & 45 \\ f_4 & = & 4 \cdot 4 & + & 48 & = & 64 \\ f_5 & = & 4 \cdot 5 & + & 65 & = & 85 \\ f_6 & = & 4 \cdot 6 & + & 90 & = & 114 \\ f_7 & = & 4 \cdot 7 & + & 119 & = & 147 \\ \end{array} $$
For such a sequence, an index $m \geq 2$ is called the starting index of interpolation if there exists a polynomial $P(n)$ such that $P(n) = f_n$ for every $n \geq m,ドル but $P(m-1) \neq f_{m-1}$. In the example above, 5ドル$ is the starting index of interpolation: for every index greater than 4ドル,ドル $f_n = P(n) = 2 n^2 + 7 n,ドル but $f_4 = 64 \neq P(4) = 60$.
You are given an integer $x$. Find any pair of parameters $f_1$ and $k$ and an index $m$ satisfying the following conditions, or report there are none:
The condition with inequalities is important. In particular, if, for some input, the only triplets $(f_1, k, m)$ which satisfy the last two conditions don't meet the first one, then you should report there is no solution.
Each test contains one or more test cases. The first line contains the number of test cases $t$ (1ドル \le t \le 100$).
The only line of each test case contains an integer $x$ (2ドル \le x \le 10^{18})$. There is at most one test case with \(x > 10^9\).
For each test case, if there is no answer, print -1.
Otherwise, output a line with three integers: $f_1,ドル $k,ドル $m$ (1ドル \leq f_1 \leq 10^{10},ドル 1ドル \leq k \leq 10^5,ドル 2ドル \leq m \leq 10^{18}$). If there are multiple solutions, print any one of them.
4 85 7 6 637275712755506
23 4 5 -1 1 2 2 -1
Warning! For the third test case, "2 2 2" is not a right answer because in that case $P(1) = f_1,ドル thus 2ドル$ is not the starting index of interpolation.