63. Multiply Two Matrices
Read two matrices and print their product.
Input ``` r1 c1 (r1 rows of c1 values) r2 c2 (r2 rows of c2 values) ```
If c1 does not equal r2 the matrices cannot be multiplied, print Invalid.
Otherwise the result has r1 rows and c2 columns, and the value at row i, column
j is the sum of A[i][k] × B[k][j] over every k.
Constraints - `1 ≤ dimensions ≤ 100` - `-1000 ≤ each value ≤ 1000`
Input
The first line contains r1 and c1.
The next r1 lines hold the first matrix.
The following line contains r2 and c2.
The next r2 lines hold the second matrix.
Output
Print r1 lines of c2 integers each, separated by single spaces, or Invalid if the shapes cannot be multiplied.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.