Solved UVa 409