Hourly Coding Problem
题号:NC222758
时间限制:C/C++/Rust/Pascal 5秒,其他语言10秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

This problem was asked by Ema.

Given an array of numbers and an integer , your task is to split into non-empty consecutive partitions such that the maximum sum of any partition is minimized. Output the length of each of the partitions. If there are multiple solutions, output the solution with the largest lexicographical order.

Solution A is considered to be lexicographically larger than Solution B if there exists an integer (), where the first partitions in A and B have the same length, and the th partition in A is longer than that in B.

For example, given and , you should output , since the optimal partition is . Note that this example used this format solely for convenience, your program should follow the format described below.

输入描述:

There are multiple test cases. The first line of the input contains an integer  indicating the number of test cases. For each test case:
The first line contains two integers and () indicating the length of the array and the number of partitions.
The next line contains integer () indicating the array.
It's guaranteed that the sum of of all test cases will not exceed .

输出描述:

For each test case, output one line containing  integers indicating the length of each of the  partitions. Note again that your answer must be the lexicographically largest answer.
示例1

输入

复制
3
7 3
5 1 0 2 7 -3 4
6 4
-1 3 -2 4 -3 5
6 2
0 -2 0 -1 -1 0

输出

复制
3 3 1
1 1 2 2
3 3