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

建议使用的浏览器:

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

5445:Food Problem

题目描述
Few days before a game of orienteering, Bell came to a mathematician to solve a big problem. Bell is preparing the dessert for the game. There are several different types of desserts such as small cookies, little grasshoppers and tiny mantises. Every type of dessert may provide different amounts of energy, and they all take up different size of space.

Other than obtaining the desserts, Bell also needs to consider moving them to the game arena. Different trucks may carry different amounts of desserts in size and of course they have different costs. However, you may split a single dessert into several parts and put them on different trucks, then assemble the parts at the game arena. Note that a dessert does not provide any energy if some part of it is missing.

Bell wants to know how much would it cost at least to provide desserts of a total energy of $p$ (most of the desserts are not bought with money, so we assume obtaining the desserts costs no money, only the cost of transportation should be considered). Unfortunately the mathematician is having trouble with her stomach, so this problem is left to you.
输入解释
The first line of input contains a integer $T (T \leq 10)$ representing the number of test cases.

For each test case there are three integers $n, m, p$ on the first line $(1 \leq n \leq 200, 1 \leq m \leq 200, 0 \leq p \leq 50000)$, representing the number of different desserts, the number of different trucks and the least energy required respectively.

The $i-th$ of the $n$ following lines contains three integers $t_i, u_i, v_i (1 \leq t_i \leq 100, 1 \leq u_i \leq 100, 1 \leq v_i \leq 100)$ indicating that the $i-th$ dessert can provide $t_i$ energy, takes up space of size $u_i$ and that Bell can prepare at most $v_i$ of them.

On each of the next $m$ lines, there are also three integers $x_j , y_j , z_j (1 \leq x_j \leq 100, 1 \leq y_j \leq 100, 1 \leq z_j \leq 100)$ indicating that the $j-th$ truck can carry at most size of $x_j$ , hiring each one costs $y_j$ and that Bell can hire at most $z_j$ of them.
输出解释
For every test case output the minimum cost to provide the dessert of enough energy in the game arena if it is possible and its cost is no more than $50000$. Otherwise, output $TAT$ on the line instead.
输入样例
4
1 1 7
14 2 1
1 2 2
1 1 10
10 10 1
5 7 2
5 3 34
1 4 1
9 4 2
5 3 3
1 3 3
5 3 2
3 4 5
6 7 5
5 3 8
1 1 1
1 2 1
1 1 1
输出样例
4
14
12
TAT
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5445

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

共提交 0

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