#P14920. [GESP202512 六级] 道具商店
[GESP202512 六级] 道具商店
Background
Corresponding multiple-choice and true/false questions: https://ti.luogu.com.cn/problemset/1202
Problem Description
There are items to choose from in the item shop. The -th item can increase the player's attack by points, and costs gold coins to buy. Each item can only be bought once. Now you have gold coins. How many attack points can you increase at most?
Input Format
The first line contains two positive integers , the number of items and the number of gold coins you have.
In the next lines, each line contains two positive integers , the number of attack points increased by the item and the number of gold coins needed to buy it.
Output Format
Output a single line with an integer, the maximum number of attack points that can be increased.
3 5
99 1
33 2
11 3
132
4 100
10 1
20 11
40 33
100 99
110
Hint
For of the test data, it is guaranteed that and .
For all the test data, it is guaranteed that , , , and .
Translated by QwenWork