Solved UVa 10664