https://osnim.github.io/posts/How-to-Solve-DP/
Algorithm 1.DP - osnim