I'm not into formulas.
first I changed the base address from A[1,1,1] to A[0,0,0] for ease of calculation so now I need to calculate A[19,19,29]
Then I go into the required 2D Matrix which is the 19th matrix where each matrix is of size 30x40 hence 19x30x40
Then I check if its col major or row major, since column major I go to reqd col which is 29th column crossing 30 elements of each row ie 29x30
Now i'll proceed to the 19th row ie 19
19x30x40 + 29x30 + 19