Set 103Question 80

Imran's Budget Split

Medium-hardWritten in CMust finish in 3 seconds

Imran needs to split a project's expense list at a hospital's records desk into K contiguous groups minimizing the maximum group total.

What your program reads

Line1: N K. Line2: N integers.

What your program prints

The minimized maximum group total.

Limits

1 ≤ K ≤ N ≤ 10^5

Example input

5 2
10 20 30 40 50

Expected output

90
main.c

Your work is saved in this browser as you type.

Loading editor…
Input for Run

Run tries your code on the input above and shows what it prints. Submit checks your output against every test, including hidden ones.

Shortcut: Ctrl + Enter sends it to the judge.

Imran's Budget Split · DIU ContestHub