Sichuan University Programming Contest 2021 Preliminary

D: