This problem is in Contest(s) below:
Contest 1008:基础动态规划