This problem is in Contest(s) below:
Contest 1041:csp/noip数学专练
Contest 1084:2021CSP第二轮专题3-贪心
Contest 1130:2022小学省赛练习题