Implementation of the problems for google-code-jam-2013