cf 278 div1 - B - dp + sliding window minima