UVa 10205: be careful with the indices