#C8067. List Primes Less Than

    ID: 52008 Type: Default 1000ms 256MiB

List Primes Less Than

List Primes Less Than

Given an integer \(n\), write a program to output all prime numbers that are strictly less than \(n\). A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. For example, when \(n=10\), the prime numbers less than 10 are 2, 3, 5, and 7.

Your program should read input from standard input (stdin) and write the result to standard output (stdout) in a single line with each prime number separated by a single space. If there are no prime numbers less than \(n\), output an empty line.

Note: Your solution must use the standard input-output methods.

inputFormat

The input consists of a single integer \(n\) (\(n \geq 0\)).

Example:

10

outputFormat

Output a single line containing all prime numbers less than \(n\), separated by a space. If no prime number exists below \(n\), output an empty line.

Example:

2 3 5 7
## sample
10
2 3 5 7