update
recursive DP
it is easy
more neat
minor