Code used for the Google Code Jam 2014 competition.