Minimum Total Cost to Process All Elements
A tank starts with k free units and each demand drains it. Refills of fixed size cost more each time, so buy only when a demand cannot be covered and add up the escalating prices.
A tank starts with k free units and each demand drains it. Refills of fixed size cost more each time, so buy only when a demand cannot be covered and add up the escalating prices.