Interesting Game

CodeForces - 87C