Dynamic programming Dynamic programming https://people.eecs.berkeley.edu/~vazirani/algorithms/chap6.pdf