Some problems require "prefix min": replace with . This truncates the function, keeping only the minimum value for all up to .
In heap terms: after computing for all , you want the function to be non-increasing. Pop from the min-heap until it's empty, leaving only the max-heap. This operation changes the function shape but preserves the slope-change representation. Use it when constraints force monotonicity.