Solved UVa 10391