#C9017. Prime Number Generator
Prime Number Generator
Prime Number Generator
You are given an integer \(n\). Your task is to generate all prime numbers that are strictly less than \(n\) using the Sieve of Eratosthenes algorithm.
The Sieve of Eratosthenes is an efficient algorithm to compute all primes up to a given number. In this problem, you will implement the sieve to list all primes less than \(n\). The algorithm marks non-prime numbers in a list and then extracts the numbers that remain marked as prime.
Example:
Input: 20 Output: 2 3 5 7 11 13 17 19
If there are no primes (for example, when \(n \le 2\)), output nothing (an empty line).
inputFormat
The input consists of a single integer \(n\) on one line, representing the upper bound (exclusive) for generating prime numbers.
outputFormat
Output the prime numbers less than \(n\) in increasing order, separated by a single space. If there are no primes, output an empty line.
## sample20
2 3 5 7 11 13 17 19