Alice and the Unfair Game

CodeForces - 1236E