Classification problem found in Google Code Jam