Java solutions to some UVA problems