Share the joy
dp[i][j] is the result between stone i, and stone j.
If left is greater, then
dp[from][from+delta] = sum(i, from+delta) + dp[i][from+delta]
Else
right part
If both left and right are same, then choose the one which dp has larger value