2901. Big Number

单点时限: 10.0 sec

内存限制: 256 MB

Trillion, quadrillion, quintillion, sextillion, septillion, octillion — all is trifle! Vasya knows how to get a really big number. One should consider several “ordinary” numbers, and then write them down consequently one after another on a piece of paper.
Vasya decided to demonstrate this idea to his elder brother Pete. He prepared a sequence of N positive integers and started writing them down one after another on a piece of paper. After observing this process for a while, Pete got tired and suggested Vasya to solve the following puzzle.
Vasya’s goal is to remove exactly K numbers from his sequence so that if one concatenates the remaining numbers (keeping the original order) he gets the largest possible number. Please, help Vasya.

输入格式

The first line contains two integers N and K denoting how many numbers are prepared by Vasya and how many of them should be removed, respectively (2 ≤ N ≤ 105, 1 ≤ K ≤ N − 1 and K ≤ 100). The second line contains N space separated positive integers not exceeding 109.

输出格式

Please, output the largest possible number Vasya can obtain by removing exactly K numbers from the sequence.

样例

Input
5 2
123 37 45 9 18
Output
1234518

7 人解决,27 人已尝试。

11 份提交通过,共有 112 份提交。

8.3 EMB 奖励。

创建: 12 年,11 月前.

修改: 6 年,8 月前.

最后提交: 9 月,1 周前.

来源: N/A

题目标签