DP problem help

I think Backtracking would help.