当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3884:Hinanai Tenshi’s peach garden

题目描述
Hinanai Tenshi is managing a peach garden in Bhavagra. Due to the careful watch of Tenshi, the peach garden becomes a great view of Bhavagra. Once a famous person whose ear is pretty big said when visiting the garden: “This is peach garden?”

Another harvest season has come, Tenshi wants to move all the peaches to one point, so Tenshi sent her sidekick, Nagae Iku, to do this mission. However, Iku was only able to move all peaches to N points before she was sent to other missions…The remaining work can only be done by Tenshi herself.

Now Iku has moved the peaches to N points, the ith point is (xi, 0), which has pi peaches on it. Moving one peach from one point to another point costs the distance between these two points, two peaches is double the cost and etc. Tenshi wants to move as many peaches to one point as possible without costing too much, so Tenshi wants to know how many peaches can she move to one point without total costing over K.
输入解释
Multiple test cases (no more than 20), for each case:
The first line contains two integers N and K (0<N<=10^4, 0<=K<=10^18).
Following N lines, each line contains two integers xi and pi (0<=xi<10^9, 0<pi<10^4).
Input terminates with EOF.
输出解释
For each cast output one integer, representing the number of peaches she can move to one place at most.
输入样例
3 1
0 1
1 1
2 1
输出样例
2
来自杭电HDUOJ的附加信息
Author temperlsyer
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3884

最后修改于 2020-10-25T23:07:53+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)