#K40077. Prime Factorization

    ID: 26562 Type: Default 1000ms 256MiB

Prime Factorization

Prime Factorization

Given a positive integer (n), compute its prime factors and output them in ascending order. Each factor should appear as many times as it divides (n). For example, if (n = 28), then the prime factors are 2, 2, and 7, because (28 = 2 \times 2 \times 7). Note that if (n = 1), there are no prime factors, and you should output an empty line.

inputFormat

A single integer (n) is given via standard input.

outputFormat

Print the prime factors of (n) in ascending order, separated by a space on one line. If (n = 1), output an empty line.## sample

28
2 2 7