Finish Poj 1062

http://www.cnblogs.com/mobileliker/p/4143127.html