You are given an array A of n elements and a constant k. You can perform the following operation on the array —
Choose any sub-array of p elements where 2≤p≤k and merge the elements into a new element. The p elements are removed and their sum is inserted as a new element in that place. The cost of this operation is the sum itself.
Calculate the minimum cost to reduce the array to only one element, by performing the mentioned operation as many times needed.
Input
First line of input will contain an integer T denoting the number of test cases.
For each test case, the first line contains two integers n and k, and the second line contains n integers A1,A2,…An.
Constraints:
1≤T≤100.
1≤n≤100.
2≤k≤50.
1≤Ai≤100.
Output
For each test case, output a line in the format “Case i: x” without the quotes, where x is the minimum cost to reduce the array to only one element, by performing the mentioned operation as many times needed.