Google code jam 2013: Qualification Round: solutions