Fast Fingers Thomas is eating poutine at Wilson's restaurant. Thomas has
There are
Compute the maximum amount of happiness Thomas can feel after eating some amount of poutine.
Constraints
Input Specification
The first line of input contains two positive integers,
Each of the next
Output Specification
Let
Sample Input
2 3
8 2
7 2
Sample Output
21
Comments