問題一覧 > 通常問題

No.414 衝動

レベル : / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 387
作問者 : ei1333333 / テスター : 37zigen
お気に入りにしたユーザー ProblemId : 1263 / 自分の提出
問題文最終更新日: 2026-06-25 10:44:40
Impulse
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
yukicoder contest 147 (順位表) の他の問題:

Problem Statement

You are suddenly seized by the impulse to do multiplication. You simply must do multiplication right now.

Find a pair of 2 natural numbers $\{x, y\}$ whose product is exactly $M$. Since $\{1, M\}$ and $\{M, 1\}$ are cheap, you must not use $1$ or $M$.

However, there are cases where no pair of $2$ natural numbers can produce the integer $M$. Only in such cases, use $\{1, M\}$ or $\{M, 1\}$.

Input

$M$

An integer $M$ is given on 1 line. It satisfies $1 \le M \le 10^{12}$.

Note that $M$ may not fit in a 32bit integer type.

Output

Output the $2$ natural numbers on 1 line, separated by a half-width space. There may be multiple solutions, in which case you may output any of them.

Sample

Sample 1
Input
4
Output
2 2

$2 \times 2 = 4$. No other solution exists.

Sample 2
Input
18
Output
6 3

$6 \times 3 = 18$. Besides this, $\{2, 9\}$, $\{3, 6\}$, and $\{9, 2\}$ are also possible, and you may output any of them.

Sample 3
Input
2
Output
1 2

There is no way to make $2$ without using $1$ and $2$, so output either $\{1, 2\}$ or $\{2, 1\}$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。