[Home|Training|Problems|Contests|C Language] | [Login|Register] |
Problems Status Rank |
Problem 1122
Millionaire Rank List
Time Limit: 1000ms
Memory Limit: 131072kb Description
In the wild universe, there lives a race of clever creature. They have high level civilization and control a lot of planets. As we human, some of us are very rich and the public like to know who are the Top 10. As a journalist of a famous new paper, you are asked to write a program to get the top 10 list. Input
The input contains only one test case. The first line contains one integer N (10 <= N <= 1,000,000), which means there are N rich people in the race. The following N lines each contains a integer Mi (Mi >= 0), which means the money of the i-th person. But as they are universal millionaires, they are very rich, which means the amount of their money can be as large as 1025. Note that Mi may have preceding zeros. Output
Output 10 lines, containing the money of the richest 10 people in descending order. Delete the preceding zeros if they once have.
Sample Input
11 1 2 3 4 5 6 7 8 9 10 15 Sample Output
15 10 9 8 7 6 5 4 3 2 |