lbest(i,i) = rbest(i,i) = best(i,i) = max{ 0, array[i] } best(i,j) = max{ rbest(i,k) + lbest(k+1,j), best(i,k), best(k+1,j) }, where k = int((j+i)/2) lbest(i,j) = max{ total(i,k) + lbest(k+1,j), lbest(i,k) }, where k = int((j+i)/2) rbest(i,j) = max{ rbest(i,k) + total(k+1,j), rbest(k+1,j) }, where k = int((j+i)/2)