index | submit | rank | book

primes – Primes

Write a program that produces all primes smaller than a given number.

Input and Output

Input will consist of several lines each containing a number n where 0 ≤ n ≤ 10 000.

For each line of input, your program should produce a line of output with all primes that are smaller than the corresponding n.

Example input

30
10

Example output

2 3 5 7 11 13 17 19 23 29
2 3 5 7

Scoring

try first: gcd lcm replace

try next: cash

index | submit | rank | book

Copyright © 2020-2021 Rudy Matela
All rights reserved