CodeChef June Challenge.
CodeRoadCodingContest 2014, round 2.