#C13402. Prime Numbers Less Than n
Prime Numbers Less Than n
Prime Numbers Less Than n
Given a positive integer \( n \), your task is to find and output all prime numbers less than \( n \) in ascending order. A prime number is a natural number greater than 1 that has no divisors other than 1 and itself. For optimal performance when \( n \) is large (up to 10 million), it is recommended to use an efficient algorithm such as the Sieve of Eratosthenes.
inputFormat
A single integer ( n ) provided via standard input.
outputFormat
Print all prime numbers less than ( n ) in a single line, separated by a space. If there are no primes, output nothing.## sample
10
2 3 5 7