#P1344. 直播获奖(2020)

直播获奖(2020)

Description

    NOI2130 即将举行。为了增加观赏性,CCF 决定逐一评出每个选手的成绩,并直播即时的获奖分数线。本次竞赛的获奖率为w% 的选手的最低成绩就是即时的分数线。


<math xmlns="http://www.w3.org/1998/Math/MathML">w\%w%,即当前排名前 <math xmlns="http://www.w3.org/1998/Math/MathML">w\%

    更具体地,若当前已评出了 <math xmlns="http://www.w3.org/1998/Math/MathML">pp 个选手的成绩,则当前计划获奖人数为 <math xmlns="http://www.w3.org/1998/Math/MathML">\max(1, \lfloor p * w \%\rfloor)max(1,pw%),其中 <math xmlns="http://www.w3.org/1998/Math/MathML">ww 是获奖百分比,<math xmlns="http://www.w3.org/1998/Math/MathML">\lfloor x \rfloorx 表示对 <math xmlns="http://www.w3.org/1998/Math/MathML">xx 向下取整,<math xmlns="http://www.w3.org/1998/Math/MathML">\max(x,y)max(x,y) 表示 <math xmlns="http://www.w3.org/1998/Math/MathML">xx 和 <math xmlns="http://www.w3.org/1998/Math/MathML">yy 中较大的数。如有选手成绩相同,则所有成绩并列的选手都能获奖,因此实际获奖人数可能比计划中多。

    作为评测组的技术人员,请你帮 CCF 写一个直播程序。


Input Format

第一行有两个整数 n w 分别代表选手总数与获奖率。
第二行有 n个整数,依次代表逐一评出的选手成绩。

Output Format

只有一行,包含 n个非负整数,依次代表选手成绩逐一评出后,即时的获奖分数线。相邻两个整数间用一个空格分隔。
10 60
200 300 400 500 600 600 0 300 200 100
200 300 400 400 400 500 400 400 300 300

Hint

【样例2】
输入
10 30
100 100 600 100 100 100 100 100 100 100
输出
100 100 600 600 600 600 100 100 100 100


Source

四阶