https://www.geeksforgeeks.org/matrix-chain-multiplication-dp-8/