http://acm.hdu.edu.cn/showproblem.php?pid=3411
http://hi.baidu.com/aekdycoin/blog/item/63f633ec11c822d8b21cb168.html