Practice · 3 of 6
Final 3: The Painters
CHALLENGE
Difficulty: advanced+25 XP
**Bài toán.** A fence of n boards in a row; board i takes a[i] minutes. You hire k painters who must each paint a **contiguous** block of boards (every board exactly one painter, blocks do not interleave). Minimize the time of the busiest painter; print it. **Constraints:** 1 ≤ k ≤ n ≤ 200000; 1 ≤ a[i] ≤ 10^6. **Input:** line 1: n, k; line 2: n values. **Output:** one integer.
Press Submit to check your solution.
Back to lesson: Practice: The Final Pack