问题3434--sort

3434: sort

[命题人 : ]
时间限制 : 5.000 sec  内存限制 : 64 MB

题目描述

Given n integer numbers, you should select the m numbers of the bigger ones and output them from big one to small one.

输入

The input file contains many test cases. Each case has 2 lines. The first line consists of 2 integer number n and m ( 0 < n, m < 1000). The next line has n numbers, and all numbers between -1000 and 1000.

输出

For each case, you should output the m integer numbers, order by descent.

样例输入 Copy

5 3
1 4 10 9 3

样例输出 Copy

10 9 4

提示

If n=10 m=3 and the 10 numbers are: 10 9 10 8 7 6 5 4 1 2 you should output: 10 10 9

来源/分类