16. Find the product $A B$, if

$$
A=\left(\begin{array}{rrr}
0 & -1 & 2 \\
2 & 1 & 1 \\
3 & 0 & 1 \\
3 & 7 & 1
\end{array}\right), \quad B=\left(\begin{array}{ll}
3 & 1 \\
2 & 1 \\
1 & 0
\end{array}\right)
$$
Solution.

$$
A B=\left(\begin{array}{ll}
0 \cdot 3+(-1) \cdot 2+2 \cdot 1 & 0 \cdot 1+(-1) \cdot 1+2 \cdot 0 \\
2 \cdot 3+1 \cdot 2+1 \cdot 1 & 2 \cdot 1+1 \cdot 1+1 \cdot 0 \\
3 \cdot 3+0 \cdot 2+1 \cdot 1 & 3 \cdot 1+0 \cdot 1+1 \cdot 0 \\
3 \cdot 3+7 \cdot 2+1 \cdot 1 & 3 \cdot 1+7 \cdot 1+1 \cdot 0
\end{array}\right)=\left(\begin{array}{rr}
0 & -1 \\
9 & 3 \\
10 & 3 \\
24 & 10
\end{array}\right)
$$

If in this example we try to find the product $B A$, we will see that it is impossible.

For rectangular matrices, the following rules apply:

1) the multiplication of matrix $A$ by matrix $B$ makes sense only if the number of columns of matrix $A$ is equal to the number of rows of matrix $B$;
2) the result of multiplying two rectangular matrices is a matrix containing as many rows as the first matrix and as many columns as the second matrix.

17-19. Find the product $A B$ :