usage
If there is a state equation $f[i][j]=min(f[i][k]+f[k+1][j])+w[i][j]$ or replace min with max
and w satisfies the monotonicity of interval inclusion and the quadrilateral inequality
Monotonicity of interval inclusion:
If for $\forall i_1<i_2$ and $j_1>j_2$ (ie $[i_2,j_2]\subset[i_1,j_1]$), there are $$
Quadrilateral inequality: