[SRM502] TheProgrammingContestDivTwo by Kaiyang Lv