Solved UVa 924