This problem is in Contest(s) below:
Contest 1523:算法基础班收官之战
Contest 1806:区一中队列、栈练习
Contest 2105:26夏令营算法提高D——结营测试
Contest 1534:mcy广搜练习