Harmonization Module
Xem dạng PDFBảo is working on a new "Harmonization Module" for his newly joined company. This module is designed to link old user data with new database entries.
For the system to work, Bảo must find two massive "key" values, ~x~ and ~y~. These keys must be successfully "harmonized" with a special "Legacy Constant" ~A~, a number Bảo is particularly fond of.
According to an old algorithm manual, a pair (~x,y~) is considered harmonized if the following formula produces a positive integer: $$\sqrt{xy+x+A}$$
The system has strict constraints: both keys ~x~ and ~y~ must be integers between ~1~ and ~10^9~ (inclusive).
Bảo needs to run ~T~ test scenarios, each with a different Legacy Constant ~A~. Your job is to help him find any valid pair ~(x,y)~ that satisfies the harmonization criteria.
Input
The first line contains a single integer ~T~ (~1 \le T \le 10^5~) — the number of test scenarios.
Each of the next ~T~ lines contains a single integer ~A~ (~−10^9 \le A \le 10^9~) — Bảo's favorite number (the Legacy Constant).
Output
For each test scenario, print a single line with two space-separated integers, ~x~ and ~y~, if a valid pair is found. If no such pair exists within the constraints, print ~−1~.
Sample Input 1
4
3
-1
2
-1000000000
Sample Output 1
11 2
10 4
14 6
1000000000 10
Bình luận
bai hay qua