Sieve Of Eratosthenes
easy
1. Given an Integer 'n'. 2. Print all primes from 2 to 'n'. 3. Portal is not forced you, but try to submit the problem in less than n.root(n) complexity.
Constraints
2 <= n <= 10^5
Format
Input
n = 10
Output
2 3 5 7
Example
Sample Input
10
Sample Output
2 3 5 7