I have the following task to solve using dynamic programming techniques. I\'ve stated the problem mathematically, along with constraints, but then I got to the dead end.