[2012 Asia Changchun Regional Contest C Problem] [HDOJ 4422]