The code I wrote for the qualifying round of the Google Code Jam