#Lutece0681. Complete Building the House
Complete Building the House
Migrated from Lutece 681 Complete Building the House
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 m 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 equal to the 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 numbers, they are the heights of the houses from left to right.()
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
11th UESTC Programming Contest Preliminary