Sichuan University Programming Contest 2017 Preliminary

C: CP