UVa 610 accepted