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

建议使用的浏览器:

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

5501:The Highest Mark

题目描述
The SDOI in $2045$ is far from what it was been $30$ years ago. Each competition has $t$ minutes and $n$ problems.

The $ith$ problem with the original mark of $A_i(A_i \leq 10^{6})$,and it decreases $B_i$ by each minute. It is guaranteed that it does not go to minus when the competition ends. For example someone solves the $ith$ problem after $x$ minutes of the competition beginning. He/She will get $A_i-B_i * x$ marks.

If someone solves a problem on $x$ minute. He/She will begin to solve the next problem on $x+1$ minute.

dxy who attend this competition with excellent strength, can measure the time of solving each problem exactly.He will spend $C_i(C_i \leq t)$ minutes to solve the ith problem. It is because he is so godlike that he can solve every problem of this competition. But to the limitation of time, it's probable he cannot solve every problem in this competition. He wanted to arrange the order of solving problems to get the highest mark in this competition.
输入解释
There is an positive integer $T(T \leq 10)$ in the first line for the number of testcases.(the number of testcases with $n>200$ is no more than $5$)

For each testcase, there are two integers in the first line $n(1 \leq n \leq 1000)$ and $t(1 \leq t \leq 3000)$ for the number of problems and the time limitation of this competition.

There are $n$ lines followed and three positive integers each line $A_i, B_i, C_i$. For the original mark,the mark decreasing per minute and the time dxy of solving this problem will spend.


Hint:
First to solve problem $2$ and then solve problem $1$ he will get $88$ marks. Higher than any other order.
输出解释
For each testcase output a line for an integer, for the highest mark dxy will get in this competition.
输入样例
1
4 10
110 5 9
30 2 1
80 4 8
50 3 2
输出样例
88
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5501

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

共提交 0

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