Sichuan University Programming Contest 2016 Preliminary

G: Easy Problem IV