Mazen challenged his brother Amir to solve this problem. Mazen loves consecutive ranges.
Given a number $$$x$$$, is there a range from $$$l$$$ to $$$r$$$ (inclusive) such that $$$\sum_{i= l}^{r} i = x$$$ where $$$(r < x)$$$.
If a range exists, output the $$$l$$$ and $$$r$$$ of such a range, otherwise output -1.
The first line contains a single integer $$$t$$$ $$$(1 \le t \le 10^3)$$$ - the number of test cases.
The only line of each test case contains one integer $$$x$$$ $$$(1 \le x \le 2.10^9)$$$
For each test case, If there is no valid range, output -1.
Otherwise, print 2 integers $$$l,r$$$ $$$(1 \le l < r < x)$$$ - indicates the range. If there are multiple solutions, output any.
3 4 9 88
-1 4 5 3 13
Name |
---|