max ending here, max so far

optimal subproblem