SPOJ A game with numbers