#K45057. Simulating Task Completion Based on Priorities

    ID: 27668 Type: Default 1000ms 256MiB

Simulating Task Completion Based on Priorities

Simulating Task Completion Based on Priorities

You are given a number of tasks, each with an associated priority value. The tasks are to be completed in order of their priorities, with higher priority tasks completed before lower priority ones.

Formally, given an integer \(n\) representing the number of tasks and a list of \(n\) integers representing the priority of each task, you must output the priorities sorted in descending order.

Note: If multiple tasks have the same priority, their order in the output does not matter since they are identical in value.

inputFormat

The input consists of two lines:

  1. The first line contains a single integer \(n\) \((1 \le n \le 10^5)\), representing the number of tasks.
  2. The second line contains \(n\) space-separated integers, each representing the priority of a task. Each priority is between \(1\) and \(10^9\).

outputFormat

Output a single line with \(n\) space-separated integers representing the tasks' priorities sorted in descending order.

## sample
6
1 4 2 5 3 2
5 4 3 2 2 1