Questions for you: where have you seen these types of problems come up in your life? Is this a known class of problems?
The solutions you derived resemble bang-bang solutions in control theory. If you have a control knob you can turn to any value between some minimum and some maximum, a bang-bang solution is an optimal solution which turns the knob all the way in one direction for a while, then turns it all the way in the other direction and leaves it there indefinitely.
The solutions you derived resemble bang-bang solutions in control theory. If you have a control knob you can turn to any value between some minimum and some maximum, a bang-bang solution is an optimal solution which turns the knob all the way in one direction for a while, then turns it all the way in the other direction and leaves it there indefinitely.