LightOJ_DP 1345
problem link: http://lightoj.com/volume_showproblem.php?problem=1345
how dp can be used to solve this problem ?