#C13215. Filter and Square

    ID: 42729 Type: Default 1000ms 256MiB

Filter and Square

Filter and Square

You are given an array of integers and a threshold value \(T\). Your task is to filter the array by selecting only the integers which are greater than or equal to the threshold, then compute the square of each selected integer and output the result. The order of the numbers must remain the same as in the original list.

In other words, for each integer \(x\) in the input array, if \(x \geq T\), then include \(x^2\) in the output.

inputFormat

The input is read from standard input and consists of three lines:

  • The first line contains a single integer \(N\) representing the number of elements in the array.
  • The second line contains \(N\) integers separated by spaces.
  • The third line contains a single integer \(T\), the threshold value.

outputFormat

Output a single line containing the squares of the integers that are greater than or equal to \(T\), separated by a space. If no integer meets the condition, output an empty line.

## sample
5
1 3 5 7 9
5
25 49 81

</p>