Implement several dynamic programming problems.