There are
Taro has decided to choose some of the
Find the maximum possible sum of the values of items that Taro takes home.
Constraints
- All values in input are integers.
Input Specification
The first line of input will contain 2 space separated integers,
The next
Output Specification
You are to output a single integer, the maximum possible sum of the values of items that Taro takes home.
Sample Input 1
3 8
3 30
4 50
5 60
Sample Output 1
90
Sample Input 2
1 1000000000
1000000000 10
Sample Output 2
10
Sample Input 3
6 15
6 5
5 6
6 4
6 6
3 5
7 2
Sample Output 3
17
Sample Explanations
For the first sample, items
For the third sample, items
Comments