#C13332. Filter Prime Numbers

    ID: 42859 Type: Default 1000ms 256MiB

Filter Prime Numbers

Filter Prime Numbers

Your task is to implement a program that reads a single line of input containing space-separated integers and filters out the prime numbers. An integer \( n \) is considered prime if \( n > 1 \) and it has no divisors other than 1 and itself. This can be formally stated as: for every integer \( k \) in the range \( 2 \le k \le \sqrt{n} \), \( k \) does not divide \( n \).

If no prime numbers exist in the input, your program should output None. The order of the prime numbers in the output should be the same as their order in the input.

inputFormat

Input is read from standard input. It consists of a single line containing space-separated integers. If the line is empty or contains only whitespace, treat it as an empty list.

outputFormat

Output to standard output the prime numbers from the input, separated by a single space. If there are no prime numbers, output "None".## sample

4 6 8 9 10
None