[2012 Asia Changchun Regional Contest B Problem] [HDOJ 4421]