Comments

Just simulate with a deque

On MikeMirzayanovPlease, read this, 3 years ago
+6

I am so sorry for your loss Mike; at least your mother must have been proud of her son <3

I cant solve b during contest, but still I think that it was a nice problem