RodCutting dyanamic programming with memoization. CLRS page : 366