Solutions to problems from Google Code Jam