This problem is in Contest(s) below:
Contest 1437:一些备选题
Contest 1435:栈队列堆