#K36337. Prime Number Generation

    ID: 25732 Type: Default 1000ms 256MiB

Prime Number Generation

Prime Number Generation

Given a non-negative integer ( n ), generate the first ( n ) prime numbers in ascending order. A prime number is a natural number ( p > 1 ) that has no positive divisors other than 1 and itself. For instance, the first 5 prime numbers are 2, 3, 5, 7, and 11. Note that if ( n ) is less than or equal to 0, the output should be empty.

inputFormat

Input is provided via standard input. The input consists of a single integer ( n ) on one line.

outputFormat

Output the first ( n ) prime numbers separated by a single space on one line using standard output. If ( n ) is less than or equal to 0, output nothing.## sample

5
2 3 5 7 11

</p>