#K75552. Unique Prime Factors

    ID: 34444 Type: Default 1000ms 256MiB

Unique Prime Factors

Unique Prime Factors

Given a positive integer \( n \), your task is to compute its distinct prime factors. The prime factors should be output in increasing order, separated by a single space. If \( n = 1 \) (which has no prime factors), print an empty line.

For example, if \( n = 28 \), the prime factors are \(2\) and \(7\) (because \(28 = 2^2 \times 7\)).

Note that each prime factor is listed only once even if it appears multiple times in the prime factorization.

inputFormat

The input is provided via standard input. It consists of a single line containing one positive integer ( n ).

outputFormat

Output the distinct prime factors of ( n ) in increasing order on a single line, separated by a single space. If ( n = 1 ), output an empty line.## sample

28
2 7

</p>