some classical examples of dynamic programming methods (collected from Introduction to Algorithms Chapter IV and Leetcode OJ)