Problem 3957 · Hard

Maximum Sum of M Non-Overlapping Subarrays II

Fill a table of best totals for each prefix and number of chosen subarrays, extending by one subarray of allowed length at a time.

Open the interactive visualisation