#K53732. Prime Factorization
Prime Factorization
Prime Factorization
Given a positive integer \(n\), compute its prime factorization. The prime factorization of \(n\) is represented as a product of primes:
[ n = p_1^{a_1} \times p_2^{a_2} \times \cdots \times p_k^{a_k} ]
Your task is to list all the prime factors (with repetition) in ascending order. For example, if \(n=315\), then the prime factors are \(3, 3, 5, 7\) because \(315 = 3^2 \times 5 \times 7\). If \(n=1\), print nothing.
inputFormat
Input is provided from standard input (stdin) as a single line containing a positive integer (n) ( (1 \leq n \leq 10^9)).
outputFormat
Output the prime factors of (n) in ascending order, separated by a single space. If (n) is 1, output an empty line.## sample
315
3 3 5 7
</p>