I have a matrix in the form below where the position is only given via one iterable (x).

```
A B
1 0 3 2
0 2 4 5
```

where for matrixA[x] and matrixB[x]

```
matrixA[0] = 1, matrixA[1] = 0, matrixA[2] = 0, matrixA[3] = 2
matrixB[0] = 3, matrixB[1] = 2 etc.
```

What would be the best way to implement a multiplication of matrices A and B (preferably in C) when the only way to receive the position within a matrix is through variable x (also have the length of width and height)?

(the examples I have gotten from google all use two variables - height and width to solve this however I'm only working with one)