https://image2.slideserve.com/4531703/basic-dynamic-programming-algorithm-t.jpg