This problem is in Contest(s) below:
Contest 1111:动态规划复习
Contest 1147:动态规划入门