http://www.cnblogs.com/kuangbin/archive/2011/07/29/2120667.html
http://www.cppblog.com/theorix/archive/2008/08/29/60406.html