Basic Problemsoptimizationlinear

Maximum Segments

Given a length n and three allowed segment lengths, split n into the maximum possible number of segments using only those three lengths, reusing any length as often as needed. Report -1 if no such split exists.

Do this lesson first: coin change

The full breakdown and animated table for this problem are still being written. In the meantime, run the four questions on it yourself — that is the whole exercise.