#C14949. Sort the List
Sort the List
Sort the List
You are given a list of integers which may include duplicate elements. Your task is to sort this list in ascending order. For example, if the input list is [34, 7, 23, 32, 5, 62, 7, 3]
, then the output should be [3, 5, 7, 7, 23, 32, 34, 62]
.
The input is provided via standard input and the output should be printed to standard output. Use an efficient sorting algorithm, and make sure all duplicate elements are preserved in their sorted order.
inputFormat
The first line of input contains an integer \(n\) representing the number of elements in the list. The second line contains \(n\) space-separated integers.
outputFormat
Output the sorted list as space-separated integers in one line. If \(n=0\), output an empty line.
## sample8
34 7 23 32 5 62 7 3
3 5 7 7 23 32 34 62
</p>