#t398. 逃亡的准备(hallows)
逃亡的准备(hallows)
Hermione's Bag
Background
Special for beginners, ^_^
Problem Description
In Harry Potter and the Deathly Hallows, Harry Potter and his friends are on the run. Now there are many things to put into Hermione's bag, but the bag has a limited size, so we can only put in the most important items. Given the quantity, volume, and value of each kind of item, find the combination that maximizes the total value of the bag, and output this value. Hermione will thank you very much.
Input Format
The first line contains integers: the number of item kinds and the carrying volume of the bag .
Lines to each contain integers: the quantity , volume , and value of the -th kind of item.
Output Format
Output one integer: the maximum total value of items that can be taken.
Sample Input 1
2 10
3 4 3
2 2 5
Sample Output 1
13
Constraints
1s, 1024KiB for each test case.
Sample Explanation
Take one of the first kind and two of the second kind. The result is .
Data Range
For of the data, , , , , .
For of the data, , , , , .