CF1787A.Exponential Equation

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Exponential Equation

You are given an integer nn.

Find any pair of integers (x,y)(x,y) (1x,yn1\leq x,y\leq n) such that xyy+yxx=nx^y\cdot y+y^x\cdot x = n.

Input

The first line contains a single integer tt (1t1041\leq t\leq 10^4) — the number of test cases.

Each test case contains one line with a single integer nn (1n1091\leq n\leq 10^9).

Output

For each test case, if possible, print two integers xx and yy (1x,yn1\leq x,y\leq n). If there are multiple answers, print any.

Otherwise, print 1-1.

Note

In the third test case, 233+322=422^3 \cdot 3+3^2 \cdot 2 = 42, so (2,3),(3,2)(2,3),(3,2) will be considered as legal solutions.

In the fourth test case, 555+555=312505^5 \cdot 5+5^5 \cdot 5 = 31250, so (5,5)(5,5) is a legal solution.

Samples

5
3
7
42
31250
20732790
-1
-1
2 3
5 5
3 13

在线编程 IDE

建议全屏模式获得最佳体验