Problem 1547 · Hard
Add the ends to the cut points, then solve each stretch between two points by trying every cut inside it.
Open the interactive visualisation