| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 0.5 초 | 2048 MB | 43 | 25 | 22 | 68.750% |
Finding the prime factorization of big numbers is a challenging task. It is so difficult that the security of almost our entire digital world, from online banking to private messages, is built upon how hard it is. In this problem, you are asked to perform such a factorization, but some relative error is allowed in your answer.
More formally, you are given an integer $X$, and you have to provide the prime factorization of any number $Y = p_1^{e_1} \cdot p_2^{e_2} \cdots p_k^{e_k}$ such that
The input consists of a single line that contains an integer $X$ ($2 \le X \le 10^{1000}$).
The first line must contain a positive integer $k$ indicating the number of different prime factors in the prime factorization of $Y = p_1^{e_1} \cdot p_2^{e_2} \cdots p_k^{e_k}$.
The $i$-th of the next $k$ lines must contain the two positive integers $p_i$ and $e_i$, representing that $p_i$ is a prime factor of $Y$ with multiplicity $e_i$.
It can be proven that a valid answer exists under the given constraints. If there are multiple solutions, output any of them.
520
3 5 1 2 3 13 1
1073741825
1 2 30
$X = 1073741825$, $Y = 2^{30} = 1073741824$, and the relative error is $\frac{|X - Y|}{X} = \frac{1}{1073741825} \le 10^{-9}$.
Note that there are other valid solutions for this test case.