Dynamic programming

Will do