隔壁几道单调队列优化动态规划板子(https://www.luogu.com.cn/problem/CF372C
https://www.luogu.com.cn/problem/P2034
https://www.luogu.com.cn/problem/P2627 )
均为蓝题,此题又加了一个二分,所以建议升蓝