#C14003. Square of Even Numbers

    ID: 43605 Type: Default 1000ms 256MiB

Square of Even Numbers

Square of Even Numbers

You are given a list of integers. Your task is to filter out all the even numbers from the list and then compute the square of each even number. The resulting list of squared numbers should be output in the same order as they appear in the input.

More formally, given a list \(a_1, a_2, \dots, a_n\), you need to form a new list consisting of \(a_i^2\) for each \(a_i\) such that \(a_i\) is even (i.e., \(a_i \mod 2 = 0\)).

If there are no even numbers, output an empty line.

inputFormat

The input is given in two lines:

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

outputFormat

Print the squared values of the even numbers separated by a single space. If there are no even numbers, print an empty line.

## sample
5
1 2 3 4 5
4 16