#C13656. Prime Number Generator

    ID: 43218 Type: Default 1000ms 256MiB

Prime Number Generator

Prime Number Generator

Given a single integer ( n ), your task is to generate the first ( n ) prime numbers using an algorithm inspired by the Sieve of Eratosthenes.

For example, if the input is 5, the output should be:
2 3 5 7 11

If ( n ) is less than or equal to zero, simply output an empty line.

inputFormat

The input consists of a single integer ( n ) on one line, representing the number of prime numbers to generate.

outputFormat

If ( n > 0 ), output the first ( n ) prime numbers separated by a single space on one line. If ( n \le 0 ), output an empty line.## sample

5
2 3 5 7 11

</p>