P3118 [USACO15JAN] Moovie Mooving G
Description
Bessie is out at the movies. Being mischievous as always, she has decided to hide from Farmer John for L (1
Input Format
The first line of input contains N and L.
The next N lines each describe a movie. They begin with its integer duration, D (1
Output Format
A single integer indicating the minimum number of movies that Bessie needs to see to achieve her goal. If this is impossible output -1 instead.
Explanation/Hint
Bessie should attend the first showing of the fourth movie from time 0 to time 20. Then she watches the first showing of the first movie from time 20 to time 65. Finally she watches the last showing of the second movie from time 65 to time 100.