Vera found an old ledger of signals in the tannery attic at the quartz ridge of Glimmerfell. The margin notes pose a precise question. Task: As values arrive one by one, after each arrival print the k-th largest seen so far, or -1 while fewer than k values exist. Input format: First line: n and k. Second line: n integers. Output format: Print n answers space-separated. Constraints: 1 <= k <= n <= 4000; -10^9 <= a[i] <= 10^9.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= k <= n <= 4000; -10^9 <= a[i] <= 10^9.
