This problem is in Contest(s) below:
Contest 1039:csp/noip动态规划专练
Contest 1137:2022年暑期普及班-DP
Contest 1048:动态规划进阶