Solved UVa 12592