Solved UVa 10170