#P1507. NASA的食物计划
NASA的食物计划
Description
The space shuttle has limited volume, and carrying overly heavy items wastes a lot of fuel money. Each food item has its own volume, mass, and contained calories. Given the maximum allowable volume and mass, output the maximum total calories achievable. Each food item can be used at most once.
Input Format
The first line contains integers, representing the maximum volume and the maximum mass .
The second line contains integer representing the total number of food items .
The next lines each contain numbers: volume , mass , and contained calories .
Output Format
One integer, representing the maximum total calories achievable (within int range).
320 350
4
160 40 120
80 110 240
220 70 310
40 400 220
550
Hint
For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号