TopCoder Open Algorithm 2014 Round 2C