Sichuan University Programming Contest 2017 Preliminary(2)

D: 化学品问题 II