#abc284d. D - Happy New Year 2023

D - Happy New Year 2023

Score : 400400 points

问题描述

你已知一个正整数 NN。已知 NN 可以表示为 N=p2qN=p^2q,其中 ppqq 是两个不同的质数。

请找出 ppqq 的值。

你需要解决 TT 个测试用例。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a positive integer NN. It is known that NN can be represented as N=p2qN=p^2q using two different prime numbers pp and qq.

Find pp and qq.

You have TT test cases to solve.

Constraints

  • All values in the input are integers.
  • 1T101\leq T\leq 10
  • 1N9×10181\leq N \leq 9\times 10^{18}
  • NN can be represented as N=p2qN=p^2q using two different prime numbers pp and qq.

Input

The input is given from Standard Input in the following format, where testi\text{test}_i represents the ii-th test case:

TT

test1\text{test}_1

test2\text{test}_2

\vdots

testT\text{test}_T

Each test case is in the following format:

NN

Output

Print TT lines.

The ii-th (1iT)(1\leq i \leq T) line should contain pp and qq for the ii-th test case, separated by a space. Under the constraints of this problem, it can be proved that the pair of prime numbers pp and qq such that N=p2qN=p^2q is unique.

Sample Input 1

3
2023
63
1059872604593911

Sample Output 1

17 7
3 7
104149 97711

For the first test case, we have N=2023=172×7N=2023=17^2\times 7. Thus, p=17p=17 and q=7q=7.

update @ 2024/3/10 11:53:48