Rod cutting problem