This problem is in Contest(s) below:
Contest 1084:2021CSP第二轮专题3-贪心
Contest 1191:2026寒假集训基础强化班