Matrix-multiplication type DP.