No.1063 Sqrt Calculation
レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 379
作問者 :
null
/ テスター :
kichi2004_
タグ : / 解いたユーザー数 379
作問者 :
null
/ テスター :
kichi2004_
問題文最終更新日: 2022-04-25 23:34:13
English (AI translation)
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.
Back to the original
yukicoder contest 250
(順位表)
の他の問題:
Problem Statement
Among the pairs of positive integers $(a, b)$ satisfying $\sqrt{n} = a \sqrt{b}$, find the one with the smallest $b$.
Input
$n$
$1 \le n \le 10^9$
All inputs are integers.
Output
Print $a, b$ on one line, separated by a space. Print a newline at the end.
Sample
Sample 1
Input
12
Output
2 3
We have $\sqrt{12} = \sqrt{2^2 \times 3} = 2 \sqrt{3}$.
Sample 2
Input
10
Output
1 10
For $1 \times \sqrt{10}$, $b$ cannot be made any smaller.
Sample 3
Input
1024
Output
32 1
We have $\sqrt{1024} = \sqrt{2^{10}} = 2^5 \sqrt{1}$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。