Problem 3500 · Hard

Minimum Cost to Divide Array Into Subarrays

Split nums into consecutive subarrays, where the i-th one costs the sum of nums up to its right end plus k times i, multiplied by the sum of cost over that subarray. Return the smallest possible total cost.

Open the interactive visualisation