Sichuan University Programming Contest 2017 Preliminary

G: 塞尔达的加基森之旅