#67Medium
Prime factorization
Time: 1 s · Memory: 256 MB
- Working with numbers
Statement
You are given a natural number (). Factor it into primes. For example, .
Input format
A single integer ().
Output format
A single line with the prime factors in increasing order, with repetitions, separated by spaces.
Examples
Input
12
Output
2 2 3
Input
97
Output
97
Note
Starting from : while is divisible by , write down and divide by ; then increase . Loop while d * d <= n. If is left at the end, it is a prime factor too (for example, itself).
