UVA 100 experimental solution