The first line contains a single integer tt (1≤t≤100001≤t≤10000) — the number of test cases. The description of test cases follows.
The first line of each test case contains three integers nn, mm, kk (1≤k≤n≤1091≤k≤n≤109, 1≤m≤1051≤m≤105, m≤nm≤n). Here nn denotes the number of cells, mm denotes the number of colors, and kk means that for every kk consecutive cells, their colors have to be distinct.
The second line of each test case contains mm integers a1,a2,⋯,ama1,a2,⋯,am (1≤ai≤n1≤ai≤n) — the numbers of times that colors have to be used. It's guaranteed that a1+a2+…+am=na1+a2+…+am=n.
It is guaranteed that the sum of mm over all test cases does not exceed 105105.
Copy
输入
第一行包含一个整数 tt(1≤t≤100001≤t≤10000)--测试用例数。测试用例说明如下。
每个测试用例的第一行包含三个整数 nn、mm、kk(1≤k≤n≤1091≤k≤n≤109,1≤m≤105≤m≤105,m≤nm≤n)。这里 nn 表示单元格数,mm 表示颜色数,kk 表示每 kk 个连续单元格的颜色必须不同。
每个测试用例的第二行包含 mm 整数 a1,a2,⋯,ama1,a2,⋯,am (1≤ai≤n1≤ai≤n)--必须使用颜色的次数。可以保证 a1+a2+...+am=na1+a2+...+am=n.
这个翻译的会重复一段nn,mm,kk这样的看着好难受。支持作者Input
The first line contains a single integer tt (1≤t≤100001≤t≤10000) — the number of test cases. The description of test cases follows.
The first line of each test case contains three integers nn, mm, kk (1≤k≤n≤1091≤k≤n≤109, 1≤m≤1051≤m≤105, m≤nm≤n). Here nn denotes the number of cells, mm denotes the number of colors, and kk means that for every kk consecutive cells, their colors have to be distinct.
The second line of each test case contains mm integers a1,a2,⋯,ama1,a2,⋯,am (1≤ai≤n1≤ai≤n) — the numbers of times that colors have to be used. It's guaranteed that a1+a2+…+am=na1+a2+…+am=n.
It is guaranteed that the sum of mm over all test cases does not exceed 105105. Copy 输入
第一行包含一个整数 tt(1≤t≤100001≤t≤10000)--测试用例数。测试用例说明如下。
每个测试用例的第一行包含三个整数 nn、mm、kk(1≤k≤n≤1091≤k≤n≤109,1≤m≤105≤m≤105,m≤nm≤n)。这里 nn 表示单元格数,mm 表示颜色数,kk 表示每 kk 个连续单元格的颜色必须不同。
每个测试用例的第二行包含 mm 整数 a1,a2,⋯,ama1,a2,⋯,am (1≤ai≤n1≤ai≤n)--必须使用颜色的次数。可以保证 a1+a2+...+am=na1+a2+...+am=n.
保证所有测试用例的 mm 之和不超过 105105。