[2012 Asia Changchun Regional Contest K Problem] [HDOJ 4430]