Finish Poj 2602

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