Solutions to a couple of the 2013 Google Code Jam qualification round