Problem 1547 · Hard

Minimum Cost to Cut a Stick

Add the ends to the cut points, then solve each stretch between two points by trying every cut inside it.

Open the interactive visualisation