Split Array Min Largest Sum

JavaScript Hard 5 views
Back to Questions

Problem Description

Given array and m, split into m continuous parts so that the largest part sum is minimum. Print that minimum largest sum.

Input Format

Line1: n m. Line2: n integers.

Output Format

One integer answer.

Sample Test Case

Input:
5 2 7 2 5 10 8
Output:
18

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next