Stuck...

Can't pass 27th point CodeForces 379C