GoogleCodeJam 2014, Round 1B, A and B, only small solutions.