Matrix-chain Multiplication