| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 1 | 1 | 1 | 100.000% |
Vasya loves catching karmons. Every karmon has a numerical parameterBP (battle power). The larger the parameter value, the stronger the karmon --- and the more valuable.
Vasya's feeling ill and he's asked his friend Peter to go karmon trapping instead of him. Peter has agreed, but Vasya also asked for another thing: he wants Peter to report the BP sum of the $K$ most powerful currently caught karmons every time Peter catches another karmon. Peter has found this request a bit weird, but there's nothing he wouldn't do for an ill friend. Nevertheless he decided to clarify things and asked Vasya what should be done if he hasn't yet collected $K$ karmons. Vasya gave it a thought and decided that in this case, Peter shouldn't report anything at all.
Help Peter write a program that is fed a list of BP's of the caught karmons and produces the values to be reported to Vasya.
The first line contains two integers: $N$ --- the total number of the trapped karmons and $K$ --- the number of karmons for which the sum of their BP must be reported (10ドル \le N \le 100,000円,ドル 2ドル \le K \le \min(N, 1000)$).
The second line contains $N$ integers defining the karmons' BP in order of catching. All these numbers lie within the range of 1ドル$ to 10ドル,000円$ inclusively.
The single line of the output file must contain $(N - K + 1)$ integers --- the sums of BP for the $K$ most powerful karmons after catching each karmon (beginning from the $K$-th one).
14 4 1 2 3 4 5 6 7 8 9 10 1 1 1 1
10 14 18 22 26 30 34 34 34 34 34