Solved UVa 616