AC POJ 1243, one person, a very good DP problem