lino and Osaragi visit houses to obtain residents' consent for a school festival.
The houses are numbered from to in the order they must be visited. This order cannot be changed.
Obtaining consent at house takes minutes.
They can spend at most minutes visiting houses on a normal day. If they rest for an entire day, they can spend up to minutes on the immediately following day. The extra time cannot be carried over to any later day.
The houses visited on a single day must form a contiguous segment of the required visiting order. Obtaining consent at one house cannot be split across multiple days.
Find the minimum number of days required to obtain consent from all houses in order. Rest days are included in the count.
The input is given in the following format:
For each test case, print the minimum number of days required to obtain consent from all houses, on one line.
By resting on the first day, they can spend minutes on the second day and visit all three houses.
They can visit houses and on the first day and houses and on the second day.
Each case is given in the following format:
There is only one house, and it can be visited in one day.
This input combines the three preceding examples. Print each case's answer on its own line.