Andy: AC code for UVa#825
Andy: AC code for UVa#10259