Industry Improvements
면접 대비시간 제한2초메모리 제한1024 MB
상자들을 주어진 순서대로 최대 k개의 연속한 구간으로 나눌 때, 구간 합의 최댓값을 최소로 만드는 용량을 구한다.
문제
As a member of the Factory Planning Committee, you are responsible for overseeing the production process and ensuring that everything runs smoothly.
The committee aims to guarantee efficient processing of boxes by the machines in the production line without breakdowns. You recognise that a machine is more prone to breaking down when handling heavier objects, and therefore, propose to set a maximum weight capacity for the machines. Considering budget constraints, the committee also agrees to limit the number of times a machine can be started to no more than times.
Your task is to determine the minimum weight capacity required for a machine line to process all boxes, while ensuring that the machine line is started no more than times and the boxes are processed in the given order.
As an example, consider the first sample input. We can process all boxes by splitting the boxes in these three contiguous subsequences: With this split, the capacity of the machine needs to be units of weight.
입력
The input consists of:
- One line with two integers and (, ), the number of boxes and the number of times the machine can be started.
- One line with integers (), the weights of the boxes, in the order in which they need to be processed.
출력
Output the minimum weight capacity required by the machine to process all boxes within runs or less.