s18-09 Dynamic programming 2