#P7072. [CSP-J 2020] 直播获奖
[CSP-J 2020] 直播获奖
Problem Description
NOI2130 is about to be held. To make it more enjoyable to watch, CCF decides to announce each contestant’s score one by one, and livestream the real-time award cutoff score. The award rate of this contest is , meaning the lowest score among the contestants currently ranked in the top is the real-time cutoff score.
More specifically, if the scores of contestants have been announced so far, then the planned number of awardees is , where is the award percentage, means rounding down, and means the larger of and . If some contestants have the same score, then all contestants tied at that score can receive an award, so the actual number of awardees may be larger than planned.
As a technician in the judging team, please help CCF write a livestream program.
Input Format
The first line contains two integers , representing the total number of contestants and the award rate.
The second line contains integers, in order, representing the scores as they are announced one by one.
Output Format
Only one line, containing non-negative integers, in order, representing the real-time award cutoff score after each contestant’s score is announced. Adjacent integers are separated by one space.
10 60
200 300 400 500 600 600 0 300 200 100
200 300 400 400 400 500 400 400 300 300
10 30
100 100 600 100 100 100 100 100 100 100
100 100 600 600 600 600 100 100 100 100
Hint
Explanation of Sample 1

Constraints and Notes
For each test point, is as shown in the table:
| Test Point ID | |
|---|---|
For all test points, each contestant’s score is a non-negative integer not exceeding . The award percentage is a positive integer and .
Hint
When computing the planned number of awardees, if you store the award ratio using floating-point variables (such as float, double in C/C++, real, double, extended in Pascal, etc.), then the result of might be or , and the floor result is uncertain. Therefore, it is recommended to use only integer variables to compute an exact value.
Translated by ChatGPT 5