UVa 10806: Runtime Error