This problem is in Contest(s) below:
Contest 1767:普及组(提高)第一天练习
Contest 1794:单调队列单调栈
Contest 1847:七年级二分练习