This problem is in Contest(s) below:
Contest 1005:竞赛较难题型练习
Contest 1142:基础班-贪心
Contest 1031:贪心算法专题