poj 1260. Pearl. DP. Simple and Good.