Codejam Qualification 2014 Solutions