uva-online-judge-problem-solution