#ABC479C. 便当装盒 / Bento Packing
便当装盒 / Bento Packing
Problem Statement
There are side dishes.
The -th side dish has a deliciousness of and a volume of .
You will choose some of the side dishes so that the total volume of the chosen dishes is at most , and pack them into a lunch box.
Find the maximum possible total deliciousness of the chosen side dishes.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Output the answer.
4 13
4 5
3 3
5 9
8 6
12
If you pack the -st and -th side dishes into the lunch box, the total deliciousness is and the total volume is .
3 99
1 100
10 100
100 100
0
You may also pack no side dishes.
5 9
6 4
9 1
2 1
4 3
5 4
21
- Source: AtCoder ABC 479 C
相关
在下列比赛中: