Andy: AC code for UVa#10404 and the corresponding test data.