UVA Problem Solve