Matrix chain multiplication, the output is optimally all bracketed (matrix-Chain)