#K68712. Sorting Weights
Sorting Weights
Sorting Weights
You are given a list of weights. Your task is to sort the weights in non-decreasing order. In other words, if the sorted list is \(a_1, a_2, \dots, a_n\), then it must satisfy \(a_i \le a_{i+1}\) for all valid \(i\).
The input will consist of an integer \(n\) indicating the number of weights, followed by \(n\) space-separated integers. The output should be the sorted weights, displayed in a single line with a space between each pair of adjacent weights.
This problem tests your ability to read data from standard input, manipulate arrays, and print results to standard output.
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains a single integer \(n\) \( (1 \le n \le 10^5)\) representing the number of weights.
- The second line contains \(n\) space-separated integers representing the weights.
outputFormat
Print the sorted list of weights as space-separated integers on one single line to standard output (stdout).
## sample5
4 2 5 1 3
1 2 3 4 5
</p>