Set 103Question 23

Sabbir's Budget Split

Medium-hardWritten in CMust finish in 3 seconds

Sabbir needs to split a project's expense list at a campus canteen 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.

Sabbir's Budget Split · DIU ContestHub