User:Sweepline/UVa 10735.cpp