Programming problems from UVA and SPOJ