#C13364. Square and Sort Array

    ID: 42894 Type: Default 1000ms 256MiB

Square and Sort Array

Square and Sort Array

Given an array of integers, for each element compute its square according to the formula $$y=x^2$$. Then, sort the squared values in non-decreasing order and output them.

The input starts with an integer n representing the number of elements, followed by n space-separated integers. The output should be the squared values sorted in ascending order, separated by spaces.

inputFormat

The first line contains an integer n (possibly zero) indicating the number of elements in the array. The second line contains n space-separated integers.

outputFormat

Output a single line with the squared values of the input integers sorted in ascending order, separated by a single space. If the array is empty, output nothing.

## sample
3
1 2 3
1 4 9

</p>