UVa 10004 accepted