Valentine's Day 2015 Contest
For whatever reason, the princesses say that they don't want to hear the #1 BABE sing his songs or read his PwP fanfiction out loud anymore! In fact, they say that they want to be home so they can pre-order Marceline's new CD, The Morning Will Wait For Us. Luckily, the Ice King is a babe and therefore is one of Marceline's best friends. He calls Marceline on his ice phone so she can "ice" the bad atmosphere in the ice room (made of ice).
To the surprise of the princesses, Marceline actually arrives, with her ax base in tow. When she enters the room she finds
To the surprise of the Ice King, everyone is into Marceline and each cage of princesses asks her to play
Input Specification
- First line:
, ( , ) - Lines
to : (space-separated), in order from cage to .
Output Specification
The maximum number of princesses that could be satisfied, i.e. have all the songs played to them.
Sample Input
4 10
2 5
4 7
3 10
1 1
Sample Output
5
Explanation
Wooing cage #2 satisfies 4 princesses, taking 7 minutes, leaving one minute to woo cage #4 for a grand total of 5 princesses wooed.
Comments
it's 2022 and this is still the best problem on this site
This comment is hidden due to too much negative feedback. Show it anyway.
adventure time isn't even an anime?
http://fc09.deviantart.net/fs71/i/2013/089/8/6/simon_and_marcy_by_fauxboy-d5zve4u.png