Ims, Master of Accessories
InterviewTime limit1sMemory limit1024 MB
Given current fatigue P and N accessories with fatigue costs A_i, find the most accessories Ims can craft while fatigue is under 200 before each craft.
Problem
MapleStory has a crafting system called Professional Skills. Professional Skills let you craft a variety of equipment and elixirs, and in exchange, a set amount of fatigue builds up. Ims, a master of accessory crafting, wants to know how to craft as many accessories as possible more efficiently.
There are accessories that Ims can make, and crafting each one adds fatigue.
Ims can craft an accessory when the accumulated fatigue is less than . If the current accumulated fatigue is , find the maximum number of accessories Ims can craft!
Input
The first line contains two integers and , separated by a space. (, )
The second line contains integers , separated by spaces. ()
Output
Print the maximum number of accessories that can be crafted.