MMFSUNDARAM - Sieve of Sundaram


In this problem you must implement Sieve of Sundaram, other solutions (algorithms) not acceptable.

Given one integer n, write prime numbers not greater than n in ascending order.

Input

One integer number2≤n≤100000.

Output

Print space separated prime numbers not greater than n in one line.

Example

Input:
7

Output:
2 3 5 7

23/06/2019 - Time limit increased.


hide comments
julkas: 2019-06-11 20:22:21

You must implement sieve of Sundaram!!! I will remove other solutions.


Added by:julkas
Date:2019-05-25
Time limit:0.300s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All