Codeforces Round #521 (Div. 3) F2(单调队列优化DP)

NoSuchKey