UVa (and others) Programming Problem Solutions