CLRS rod cutting problem