| Author: | Pavel Mesenev | Time limit: | 2 sec | |
| Input file: | Standard input | Memory limit: | 256 Mb | |
| Output file: | Standard output |
Values arrive one at a time (n of them), and you are given k. After each arrival, once at least k values have arrived, report the k-th largest value seen so far. Arrivals before the k-th produce no output.
The first line contains two integers n and k. The second line contains n space-separated integers — the values, in arrival order.
Print one line per arrival from the k-th onward: the k-th largest value seen so far at that point.
1 ≤ k ≤ n ≤ 2 ⋅ 105
− 109 ≤ value ≤ 109
| No. | Standard input | Standard output |
|---|---|---|
| 1 |
|
|
| 2 |
|
|