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

建议使用的浏览器:

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

3602:2012

题目描述
As we know,2012 is coming,and the presidents of many countries have planned to board the airships.We also know that every president i will bring a[i] bodyguards to make sure his safe,and he will pay b[i] billion dollars to U.N. We also know that some countries are more powerful than others,so if we have chose some countries to board the ship,we must make the powerful countries board first,and make sure that the bodyguards stay the same ship with his president.
Now,U.N has m ships. And every ship can only contain k people.So cannot hold all the people,but the U.N want to make more mongey .Make the most money for the U.N,then the U.N will give Lazy Yangyang a chance to survive when 2012 is coming.
Lazy Yangyang want to be safe so that he can inherit the job of ACM for the new world.To make the dream come true,the acmers of the world are solving the problem for Lady YY,and you are one of them………
输入解释
In the first line there is an integer T, indicates the number of test cases. (T <= 10)
In each case, the first line contains three integers n,m and k. (0 <m<=n <=100,0<k<100000)
Then n line,every line has two integers a[i]、b[i], (0<=a[i]<100000,0<=b[i]<100)representing the bodyguards and dollars, ordered by their power,The first country is the most powerful country.
输出解释
Most money that U.N can get.
输入样例
1
4 2 400
60 1
180 1
180 1
260 1
输出样例
3

提示
You can choose country 1 3 4,make the 1 3 at ship 1,and make country 4 at ship 2;but you cannot make 1 4 at ship 1, and country 2 3 at ship 2,
because 2 is more powerful than country 4, so 2 should sit behind country 1!
来自杭电HDUOJ的附加信息
Author alpc72
Recommend zhengfeng

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

源链接: HDU-3602

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

共提交 0

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