1176: [CSP-J2020] 直播获奖

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:1 解决:1

题目描述

NOI2130 即将举行。为了增加观赏性,CCF 决定逐一评出每个选手的成绩,并直播即时的获奖分数线。本次竞赛的获奖率为 lns="http://www.w3.org/1998/Math/MathML">%,即当前排名前 lns="http://www.w3.org/1998/Math/MathML">% 的选手的最低成绩就是即时的分数线。

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

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

输入

第一行有两个整数 lns="http://www.w3.org/1998/Math/MathML">,。分别代表选手总数与获奖率。
第二行有 lns="http://www.w3.org/1998/Math/MathML"> 个整数,依次代表逐一评出的选手成绩。

输出

只有一行,包含 lns="http://www.w3.org/1998/Math/MathML"> 个非负整数,依次代表选手成绩逐一评出后,即时的获奖分数线。相邻两个整数间用一个空格分隔。

样例输入

10 60
200 300 400 500 600 600 0 300 200 100

样例输出

200 300 400 400 400 500 400 400 300 300

提示

数据规模与约定

各测试点的 lns="http://www.w3.org/1998/Math/MathML"> 如下表:

测试点编号 lns="http://www.w3.org/1998/Math/MathML">=
lns="http://www.w3.org/1998/Math/MathML">13 lns="http://www.w3.org/1998/Math/MathML">10
lns="http://www.w3.org/1998/Math/MathML">46 lns="http://www.w3.org/1998/Math/MathML">500
lns="http://www.w3.org/1998/Math/MathML">710 lns="http://www.w3.org/1998/Math/MathML">2000
lns="http://www.w3.org/1998/Math/MathML">1117 lns="http://www.w3.org/1998/Math/MathML">104
lns="http://www.w3.org/1998/Math/MathML">1820 lns="http://www.w3.org/1998/Math/MathML">105

对于所有测试点,每个选手的成绩均为不超过 lns="http://www.w3.org/1998/Math/MathML">600 的非负整数,获奖百分比 lns="http://www.w3.org/1998/Math/MathML"> 是一个正整数且 lns="http://www.w3.org/1998/Math/MathML">199


在计算计划获奖人数时,如用浮点类型的变量(如 C/C++ 中的 float 、 double,Pascal 中的 real 、 double 、 extended 等)存储获奖比例 lns="http://www.w3.org/1998/Math/MathML">%,则计算 lns="http://www.w3.org/1998/Math/MathML">5×60% 时的结果可能为 lns="http://www.w3.org/1998/Math/MathML">3.000001,也可能为 lns="http://www.w3.org/1998/Math/MathML">2.999999,向下取整后的结果不确定。因此,建议仅使用整型变量,以计算出准确值。

来源/分类