Sichuan University Programming Contest 2017 Preliminary

D: Κύ½ψΗς