Four Matrices $M_1, M_2, M_3$ and $M_4$ of dimensions $ p \times q$, $q \times r$, $r \times s$ and $s \times t$ respectively can be multiplied in several ways with different number of total scalar multiplications. For example, when multiplied as $((M_1 \times M_2) \times (M_3 \times M_4))$, the total number of multiplications is $pqr + rst + prt$. When multiplied as $(((M_1 \times M_2) \times M_3) \times M_4)$, the total number of scalar multiplications is $pqr + prs + pst$.
If $p=10, q=100, r=20, s=5$ and $t=80$, then the number of scalar multiplications needed is
- $248000$
- $44000$
- $19000$
- $25000$