eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Big Number

Big Number

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. \InputFile The first line contains two integers \textbf{N} and \textbf{K} denoting how many numbers are prepared by Vasya and how many of them should be removed, respectively (\textbf{2} ≤ \textbf{N} ≤ \textbf{10^5}, \textbf{1} ≤ \textbf{K} ≤ \textbf{N} − \textbf{1} and \textbf{K} ≤ \textbf{100}). The second line contains \textbf{N} space separated positive integers not exceeding \textbf{10^9}. \OutputFile Please, output the largest possible number Vasya can obtain by removing exactly K numbers from the sequence.
Ліміт часу 3 секунди
Ліміт використання пам'яті 256 MiB
Вхідні дані #1
5 2
123 37 45 9 18
Вихідні дані #1
1234518
Джерело ACM ICPC 2010-2011 NEERC Moscow Subregional