#Lutece0004. Complete Building the Houses
Complete Building the Houses
Migrated from Lutece 4 Complete Building the Houses
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Bear has a large, empty ground for him to build a home. He decides to build a row of houses, one after another, say in total.
The houses are designed with different height. Bear has workers in total, and the workers must work side by side. So at a time bear can choose some continuous houses, no more than , and add their heights by one, this takes one day to finish.
Given the designed height for each house, what is the minimum number of days after which all the houses’ heights are no less than the original design?
Input
The first line of input contains a number , indicating the number of test cases. ()
For each case, the first line contains two integers and : the number of houses and the number of workers. The next line comes with non-negative numbers, they are the heights of the houses from left to right. (, each number will be less than )
Output
For each case, output Case #i:
first. ( is the number of the test case, from to ). Then output the days when bear’s home can be built.
Samples
2
3 3
1 2 3
3 3
3 2 1
Case #1: 3
Case #2: 3
Resources
The 11th UESTC Programming Contest Final