#C12781. Filter Out Prime Numbers

    ID: 42246 Type: Default 1000ms 256MiB

Filter Out Prime Numbers

Filter Out Prime Numbers

You are given a list of integers. Your task is to filter out all prime numbers from the list and output the remaining numbers in the same order as they appear in the input.

A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. In mathematical terms, a number \( p \) is prime if and only if \( p > 1 \) and for any divisors \( a \) and \( b \) such that \( ab = p \), at least one of \( a \) or \( b \) must be equal to 1.

If there are no non-prime numbers in the list, the output should be empty.

inputFormat

The input is given via standard input and consists of two lines:

  • The first line contains a single integer \( n \), denoting the number of elements in the list.
  • The second line contains \( n \) space-separated integers.

outputFormat

Output the filtered list of integers with all prime numbers removed. The numbers should be printed in the same order as they appear in the input, separated by a single space. If the result is an empty list, output nothing (or an empty line).

## sample
10
1 2 3 4 5 6 7 8 9 10
1 4 6 8 9 10