Wet Shark and Blocks

CodeForces - 621E