Generate Composite numbers

3.6

12 votes
Easy-Medium
Problem

In this problem you will be given a range 'n', and you are supposed to find all composite numbers within that range. Make your program efficient as time limit of the program is set to 1 second. Choose an efficient algorithm to find all the composite numbers within the range 0 to n.

Input

n - a single positive Integer.

Output

Space separated composite-numbers within the range of 0 and n.

Constrains

1 <= n <= 10000

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?