This problem is in Contest(s) below:
Contest 1441:YC-NOIP普及
Contest 1381:暑假背包训练
Contest 1247:小斗士暑假题库
Contest 1428:YC-递归深搜复习
Contest 1084:Dp入门