Valentine's Day, which coincidentally falls on the same day as the CCC this year, is rapidly approaching! You, having sorted out your priorities, are preparing sweets to give out to your classmates. You have
However, before you spread happiness throughout the classroom, you decide to give some chocolates to your "special someone" before anyone else. Since you don't want things to get out of hand, you set up some rules for yourself. Firstly, you can give this person more than one cup of chocolates, but if you do, they must be numbered in order. For example, you may give this person cups 1, 2, and 3, but not cups 4, 5, and 7.
Additionally, you want to limit the total sweetness that you give out, so that this person doesn't get diabetes. Thus, after filling all the cups, you decide upon an inclusive upper limit
Input Specification
The first line of input will contain two space-separated integers
Constraints
Output Specification
Output a single integer representing the maximum number of cups of chocolate that you could give to your "special someone".
Sample Input
6 5
1 4 4
1 3 2
4 5 4
2 3 1
6 6 1
13
Sample Output
3
Explanation
You have
Comments
does
restrict the maximum amount of cups or candies?
the cups you give out must be consecutive? so 4 5 6 works but not 4 5 7?
Yes for this problem, "numbered in order" would mean consecutive.