Catch the Coin

CodeForces - 1989A