Yeah
don't think from prospective of formula
for example shape is T
then, the elements will be
A[1][1] A[1][2].............................A[1][100]
A[2][50]
.
.
A[100][50]
here you know if u want to reach A[1][1] you need not cross any element, therefore, RMO = base =1000
for A[1][2] = 1000+1
for A[2][5] this kinda arrangement won't exist.
for A[100][50] = 1000 + cross row 1(100 elements) + 1element in all 98rows