#C13277. Sorted Squares
Sorted Squares
Sorted Squares
Given a list of integers, compute the square of the absolute value of each number and then output these squares in ascending order. For each integer \(n\), you need to compute \(|n|^2\) and sort the resulting values. Read the input from standard input and print the result to standard output.
inputFormat
The input is given in two lines. The first line contains a single integer (n) representing the number of integers. The second line contains (n) space-separated integers.
outputFormat
Output a single line containing the sorted squares of the input integers, separated by spaces.## sample
4
1 2 3 4
1 4 9 16