Code used on the Google Code Jam