Codeforces Round 736 (Div. 2)
A
Gregor and Cryptography
Codeforces
800
原题
←B →
翻译中…

Gregor is learning about RSA cryptography, and although he doesn't understand how RSA works, he is now fascinated with prime numbers and factoring them.

翻译中…

Gregor's favorite prime number is $P$. Gregor wants to find two bases of $P$. Formally, Gregor is looking for two integers $a$ and $b$ which satisfy both of the following properties.

翻译中…
  • $P \bmod a = P \bmod b$, where $x \bmod y$ denotes the remainder when $x$ is divided by $y$, and
  • $2 \le a \lt b \le P$.
翻译中…

Help Gregor find two bases of his favorite prime number!

翻译中…

Input

翻译中…

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 1000$).

翻译中…

Each subsequent line contains the integer $P$ ($5 \le P \le {10}^9$), with $P$ guaranteed to be prime.

翻译中…

Output

翻译中…

Your output should consist of $t$ lines. Each line should consist of two integers $a$ and $b$ ($2 \le a \lt b \le P$). If there are multiple possible solutions, print any.

翻译中…

Note

翻译中…

The first query is $P=17$. $a=3$ and $b=5$ are valid bases in this case, because $17 \bmod 3 = 17 \bmod 5 = 2$. There are other pairs which work as well.

翻译中…

In the second query, with $P=5$, the only solution is $a=2$ and $b=4$.

翻译中…

样例

Input #1
2
17
5
Output #1
3 5
2 4
InputCopy OutputCopy
题目信息
题号
1549A
时间限制
1 s
内存限制
256 MB
标签
数学
数论

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