UVa 957 accepted