#K61617. Filter Even Numbers

    ID: 31350 Type: Default 1000ms 256MiB

Filter Even Numbers

Filter Even Numbers

You are given a list of integers. Your task is to filter the list and output only the even numbers.

An integer \(n\) is even if \(n \mod 2 = 0\). In other words, if the remainder when \(n\) is divided by 2 is 0, then \(n\) is even.

The even numbers should be printed in their original order and separated by a single space. If there are no even numbers, print an empty line.

inputFormat

The input is read from standard input (stdin). It contains two lines:

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

outputFormat

Output the filtered even numbers in the same order as they appear in the input, separated by a single space. If there are no even numbers, output an empty line.

## sample
5
2 4 6 8 10
2 4 6 8 10

</p>