#1474. 获奖直播
获奖直播
Description
NOI2130 will be held soon. In order to improve the viewing experience, CCF decided to reveal the scores of each participant one by one and broadcast real-time cutoffs. The win percentage of the competition is , which means that among the participants who are currently in the top , the minimum score of a participant is the current cutoff for winning.
More specifically, if the scores of participants have been revealed, the number of winners according to current scores is , where is the win percentage of the competition, is the largest integer that doesn't exceed , and is the the larger number out of and . If there are multiple participants with the same score as the cutoff, all of them are also winners, so the actual number of winners may be more than calculated above.
As a technician of the evaluation team, please help CCF write a live broadcast program.
Input Format
The first line contains two integers and - the total number of participants and the win percentage respectively.
The second line contains integers denoting the scores of the participants that are revealed one by one (from left to right).
Output Format
Print a single line containing space-separated non-negative integers denoting the cutoffs after the participants' scores are revealed one by one. The -th integer should be the cutoff after the scores of the first participants have been revealed.
10 60
200 300 400 500 600 600 0 300 200 100
200 300 400 400 400 500 400 400 300 300
The first table below shows the number of winners as calculated by the formula after each participant's score is revealed. The first row contains the number of participants whose scores have been revealed, and the second row contains the corresponding number of winners as calculated by the formula. Note that after the 9th participant's score is revealed, the calculated number of winners is 5, but because there is another participant having the cutoff score, the actual number of winners is 6.
The second table below shows the scores of the participants from high to low (where the underlined score is the cutoff).
10 30
100 100 600 100 100 100 100 100 100 100
100 100 600 600 600 600 100 100 100 100
Constraints
Tests :
Tests :
Tests :
Tests :
Tests :
For all the tests, each participant's score is a non-negative integer not greater than , the win percentage is a positive integer, and .
For calculating the number of winners, if you use floating-point numbers (such as float, double in C, C++, real, double, extended in Pascal, etc.) to store the win percentage , the result of may be , or it may be , or something else. The result of rounding down a number like this may be uncertain. Therefore, it is recommended to use only integers to calculate accurate values.