-->
当前位置:首页 > 题库

PROGRAMMING:Live Award

Luz5年前 (2021-05-10)题库457
A programming contest will be held soon. In order to increase the appreciation, the organizing committee decided to evaluate each player's performance one by one, and broadcast the real-time winning score line. The winning rate of this competition is w%, that is, the lowest score of the current top w% is the real-time score line.
More specifically, if P contestants have been selected, the current number of winners is max (1, ⌊ p * W% ⌋), where W is the percentage of winners, ⌊ x ⌋ denotes rounding down x, and max (x, y) denotes the larger of X and y. If any contestant has the same score, all the contestants with the same score can win the prize, so the actual number of winners may be more than the planned number.
As a technician of the evaluation group, please help the organizing committee write a live program.
###Input format:
The first line has two integers n, W. They represent the total number of contestants and the winning rate respectively.
There are n integers in the second line, which represent the results of each player.
###Output format:
There is only one line, containing N non negative integers, which represent the scores of the contestants in turn. After the contestants are evaluated one by one, the winning score line will be obtained immediately. Two adjacent integers are separated by a space. There is no space after the last integer.
###Input sample 1:
Here is a set of inputs. For example:
```in
10 60
200 300 400 500 600 600 0 300 200 100
```
###Output sample 1:
The corresponding output is given here. For example:
```out
200 300 400 400 400 500 400 400 300 300
```
###Input sample 2:
Here is a set of inputs. For example:
```in
10 30
100 100 600 100 100 100 100 100 100 100
```
###Output sample 2:
The corresponding output is given here. For example:
```out
100 100 600 600 600 600 100 100 100 100
```
###Note
![ l453vhow.png](~/f89e012b-9dea-42d7-b667-2a80759a5a9b.png)
###Data scale and agreement
The n values of each test point are as follows:
Test point number n=
1∼3 ten
4∼6 five hundred
7∼10 2000
11∼17 10000
18∼20 100000
For all test points, the score of each contestant is a non negative integer no more than 600, and the winning percentage W is a positive integer and 1 ≤ w ≤ 99< br>





answer:If there is no answer, please comment