How to construct Bottom Up for this question?

dynamic-programming

#1

link text