#P2511. [HAOI2008] 木棍分割

    ID: 1526 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>动态规划,dp贪心2008河南各省省选前缀和

[HAOI2008] 木棍分割

Description

There are nn sticks. The length of the ii-th stick is LiL_i. The nn sticks are connected in the order of their indices (that is, the leftmost is the 11-st stick, then the 22-nd stick, and so on). There are n1n-1 joints in total. You are allowed to cut at most mm joints. After cutting, the nn sticks are divided into several segments. The requirement is to minimize the length of the longest segment.

Output the minimum possible value of the length of the longest segment, and the remainder of the number of schemes that achieve this minimum when divided by 1000710007.

Input Format

The first line contains two positive integers n,mn, m.

The next nn lines each contain a positive integer LiL_i, representing the length of the ii-th stick.

Output Format

Output 22 integers: the minimum possible value of the length of the longest segment, and the remainder of the number of schemes that achieve this minimum when divided by 1000710007.

3 2                           
1 
1
10
10 2

Hint

Sample Explanation

You can cut once to split into two parts of total lengths 1,11, 1 and 1010, or cut twice to split into three parts of total lengths 11, 11, and 1010.

Constraints

For all testdata, $n \le 50000,\ 0 \le m \le \min(n-1, 1000),\ 1 \le L_i \le 1000$.

Translated by ChatGPT 5