~/algor $ cat problems/ikki-korsatkich-saralangan-kvadratlar
Sorted squares
Easy
1000 ms
128 MB
27%
An array of $n$ integers sorted in non-decreasing order is given (the numbers may be negative). Compute the square of every element and print the squares in non-decreasing order.
Input
The first line contains a positive integer $n$.
The second line contains $n$ integers $a_{i}$.
Output
One line with $n$ numbers separated by spaces.
Note
$1 \le n \le 10^{5}$
$-10^{9} \le a_{i} \le 10^{9}$
the array is in non-decreasing order
Examples
Input #1
5 -4 -1 0 3 10
Output #1
0 1 9 16 100
Input #2
1 -7
Output #2
49