提示: 欢迎访问OurACM平台。
Problem 1437 Minimal m Sums

Accept: 184    Submit: 591
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Given a sequence of n integers, you are to divide the sequence into m parts, so that the maximal sum for each part is minimized.

Input

There are several test cases. Each case contains two lines. There are two integers n and m in the first line. n is the length of the sequence, and m is number of subsequence you have to divide into. The following line contains n integers representing the sequence. (0<=m,n<=100,m<=n)

Output

Output one integer that represents the expected result for each case.

Sample Input

1 1 10

Sample Output

10

Source

FZU 2006 Summer Training II

Submit  Back  Status  Discuss