Sichuan University Programming Contest 2017 Preliminary(2)

J: windy's cake V