Solutions for Google Code Jam programming contest