#C12416. Generate First N Prime Numbers

    ID: 41841 Type: Default 1000ms 256MiB

Generate First N Prime Numbers

Generate First N Prime Numbers

Given an integer \(n\), write a program that outputs the first \(n\) prime numbers in ascending order using an efficient algorithm for prime detection. If \(n \le 0\), output an empty line.

Note: A prime number is an integer greater than 1 that has no positive divisors other than 1 and itself. For example, the first few prime numbers are \(2, 3, 5, 7, \dots\).

inputFormat

The input consists of a single integer \(n\) provided via standard input. \(n\) can be zero or negative.

outputFormat

Output the first \(n\) prime numbers separated by a space on a single line to standard output. If \(n \le 0\), output an empty line.

## sample
0