#P1706D1. Chopping Carrots (Easy Version)
Chopping Carrots (Easy Version)
No submission language available for this problem.
Description
This is the easy version of the problem. The only difference between the versions is the constraints on , , , and the sum of over all test cases. You can make hacks only if both versions of the problem are solved.
Note the unusual memory limit.
You are given an array of integers of length , and an integer .
The cost of an array of integers of length is
Here, denotes the integer part of the division of by . Find the minimum cost of an array such that for all .
The first line contains a single integer () — the number of test cases.
The first line of each test case contains two integers and ().
The second line contains integers ().
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, print a single integer — the minimum possible cost of an array satisfying the condition above.
Input
The first line contains a single integer () — the number of test cases.
The first line of each test case contains two integers and ().
The second line contains integers ().
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each test case, print a single integer — the minimum possible cost of an array satisfying the condition above.
Samples
Note
In the first test case, the optimal array is . The resulting array of values of is . The cost of is . We can show that there is no array (satisfying the condition from the statement) with a smaller cost.
In the second test case, one of the optimal arrays is , which results in all being .
In the third test case, the only possible array is .