Add solution for UVa #10701