Matrix chain multiplication

why we are adding the cost like arr[x]+arr[k+1]+arr[y+1]??