Solve UVa 10164 - Number Game.