#K62477. List of Primes Less Than N

    ID: 31540 Type: Default 1000ms 256MiB

List of Primes Less Than N

List of Primes Less Than N

Given a non-negative integer n (where \(n \ge 0\)), output all prime numbers less than n in increasing order using the Sieve of Eratosthenes algorithm.

If there are no prime numbers less than n (for example, when n is 0, 1, or 2), output an empty line.

inputFormat

The input consists of a single integer n provided via stdin.

Example:

10

outputFormat

Output the prime numbers less than n in one line, separated by a single space. If there are no such prime numbers, output an empty line.

Example:

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