This problem is in Contest(s) below:
Contest 2084:26冬令营算法基础——结营测试
Contest 1947:桶