TypeDB Forces 2023 (Div. 1 + Div. 2, Rated, Prizes!)
A
Exponential Equation
Codeforces
800
原题
←B →
翻译中…

You are given an integer $n$.

翻译中…

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

翻译中…

Input

翻译中…

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

翻译中…

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

翻译中…

Output

翻译中…

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

翻译中…

Otherwise, print $-1$.

翻译中…

Note

翻译中…

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

翻译中…

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

翻译中…

样例

Input #1
5
3
7
42
31250
20732790
Output #1
-1
-1
2 3
5 5
3 13
InputCopy OutputCopy
题目信息
题号
1787A
时间限制
1 s
内存限制
256 MB
标签
构造
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。