This problem is in Contest(s) below:
Contest 1213:10月13日选修课1班作业
Contest 1084:2021CSP第二轮专题3-贪心
Contest 1173:基础课程-贪心