The people sitting around you are all talking panickedly to each other.
is drinking copious amounts of coffee, and has resorted to trying random things in Python. 's eyes are about 2 cm away from her computer screen, and is crying under the table. It seems that the only person in the room that's relaxing is , but that's beside the point.You really tried, but animation with HSA Console has really stumped you, and now you're left with an unfinished MyCreation assignment due at the end of the period!
However, there's still some mandatory features that you still have left to implement; not implementing them will lose you marks!
You have features that you still haven't implemented, and each feature has a mark value of and takes minutes to implement.
What is the maximum amount of marks you can get with the minutes you have left?
Constraints
Subtask 1 [25%]
Subtask 2 [75%]
No further constraints.
Input Specifications
The first line will contain two space-separated integers, and .
The next lines will contain two space-separated integers, .
Output Specifications
Output a single integer, , the maximum number of points you can get with a total time consumption sum of less than or equal to .
Sample Input 1
3 7
4 2
8 1
6 5
Sample Output 1
14
Sample Case 1 Explanation
By taking the 2nd and 3rd features to implement, you take 6 minutes to implement them to provide you with a mark value of 14 (oh goodness me you still failed the assignment horribly).
Sample Input 2
3 10
1 100
100 1
100 1
Sample Output 2
200
Sample Case 2 Explanation
By taking the 2nd and the 3rd features again, you take 2 minutes to implement and receive a mark value of 200. Surely no one's gonna notice that you have a 200% in MyCreation...
Comments