ICPC 2010 Problem J
http://cm.baylor.edu/ICPCWiki/attach/Problem%20Resources/2010WorldFinalProblemSet.pdf
傳說中好威的興國哥 ...