Problem G. Consumer
时间限制 2000 ms
内存限制 64 MB
FJ is going to do some shopping, and before that, he needs some boxes to carry the different kinds of stuff he is going to buy. Each box is assigned to carry some specific kinds of stuff (that is to say, if he is going to buy one of these stuff, he has to buy the box beforehand). Each kind of stuff has its own value. Now FJ only has an amount of W dollars for shopping, he intends to get the highest value with the money.
输入数据
输出数据
For each test case, output the maximum value FJ can get
样例输入
复制
3 800
300 2 30 50 25 80
600 1 50 130
400 3 40 70 30 40 35 60
样例输出
$ Mathjax font initiator $