#P2034. 汛期-1
汛期-1
Description
August is during the flood season, and BJ City experienced severe flooding. Xiao Wei needs to help carry the sandbag. Different sandbags have different volumes, and the larger the volume, the better they can hold back water. The larger the volume and weight, the more limited Xiaowei's physical strength is. The larger the weight of the sandbag, the more physical strength Xiaowei needs. Here are the volumes and required physical strength of some sandbags. Please use programming to determine the maximum number of sandbags that Xiao Wei can move
Input Format
Enter the first line, enter , to represent the total amount of sandbags and Xiao Wei's physical strength
Enter lines, two numbers per line, , , representing the volume and required physical strength of each sandbag
Output Format
Output a total of one row, output the maximum total volume of sandbags that Xiaowei can move
Example
Input Example
4 100
1000 80
500 40
100 8
50 4
Output Example
1100