This problem is in Contest(s) below:
Contest 1018:贪心算法(提高篇)