Added a solution to uva online judge problem 10000