#K72247. Sort Coins

    ID: 33711 Type: Default 1000ms 256MiB

Sort Coins

Sort Coins

You are given a list of integers representing the values of coins. Your task is to sort these coin values in non-decreasing order. That is, the sorted list should satisfy the condition \(a_{i} \le a_{i+1}\) for every valid index \(i\).

For example:

  • Input: [5, 3, 2, 8, 1] → Output: [1, 2, 3, 5, 8]
  • Input: [10, 90, 15, 25, 60] → Output: [10, 15, 25, 60, 90]
  • Input: [2] → Output: [2]

Read the input from standard input and write the sorted coin values to standard output.

inputFormat

The input consists of two lines. The first line contains an integer (n) (the number of coins). The second line contains (n) space-separated integers representing the coin values.

outputFormat

Output a single line containing the sorted coin values separated by a space.## sample

5
5 3 2 8 1
1 2 3 5 8