Home => ProblemSet => 抄书 Copying Books
Problem1889--抄书 Copying Books

1889: 抄书 Copying Books

Time Limit: 1 Sec  Memory Limit: 128 MB  Submit: 0  Solved: 1
[ Submit ] [ Status ] [ Creator: ][ 参考程序 ]

Description

把一个包含m个正整数的划分成k个(1<=k<=m<=500)非空的连续子序列,使得每个正整数恰好属于一个序列。
设第i个序列的各数之和为S(i),你的任务是让max{S(i)}最小,输出依次个数字最小的情况。

Input

Output

Sample Input Copy

2
9 3
100 200 300 400 500 600 700 800 900
5 4
100 100 100 100 100

Sample Output Copy

100 200 300 400 500 / 600 700 / 800 900
100 / 100 / 100 / 100 100

Source/Category