#C12383. Filter Perfect Squares

    ID: 41804 Type: Default 1000ms 256MiB

Filter Perfect Squares

Filter Perfect Squares

Given a list of integers, your task is to filter out the numbers that are perfect squares. A perfect square is defined as an integer \(n\) for which there exists an integer \(k\) such that \(n = k^2\) (with \(n \geq 0\)).

You need to read the list from standard input and output the perfect squares in the same order as they appear in the list.

inputFormat

The input consists of two lines:

  • The first line contains a single integer \(N\) (\(0 \leq N \leq 10^5\)) - the number of integers in the list.
  • The second line contains \(N\) space-separated integers.

outputFormat

Output a single line containing the list of perfect squares extracted from the input, in their original order, separated by a single space. If there are no perfect squares, output an empty line.

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

</p>