Greedy Algorithm And Dynamic Programming And Optimal Control Of The Linear