#K58372. Unique Squares
Unique Squares
Unique Squares
Given a list of integers, compute the square of each integer, i.e., for each integer \(x\), calculate \(x^2\). The output should contain only the unique squared values and must preserve the order in which the squared values appear for the first time in the list.
For example, when the number 2 appears in the list, its square \(2^2=4\) is computed. If \(-2\) later appears, its square is also 4, but since 4 is already in the output, it is skipped.
Your task is to read the input from standard input (stdin) and print the result to standard output (stdout).
inputFormat
The first line of input contains a single integer \(n\), representing the number of elements in the list. The second line contains \(n\) space-separated integers.
outputFormat
Output a single line containing the unique squared values separated by a single space. If there is no number in the list, output an empty line.
## sample6
2 -2 3 2 -3 4
4 9 16