UVA programming problems solved using Java