To access element $a_{i,j,k}$ in array $A_{p,q,r}$ for RMO with elements starting from 0, use below formula:
$a_{i,j,k} = [i(q+r) + j*r + k] size + base$
Now, modifying it for CMO with elements starting from 1:
$a_{i,j,k} = [(k-1)(p+q) + (j-1)*q + (i-1)] size + base$
I am not sure about it, so you should check it out. But this is what we get if we go with the logic of how we derive for CMO in 2-D array.