#K69252. Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
This problem requires you to compute the product of two matrices. Given two matrices A and B, the product matrix C is defined by the formula:
$$C_{ij} = \sum_{k=1}^{N} A_{ik} \times B_{kj}$$
You are given the dimensions of matrix A and matrix B, along with their elements. Your task is to perform matrix multiplication and output the resulting matrix.
inputFormat
The first line of input contains three integers M, N, and P where M is the number of rows of matrix A, N is the number of columns of matrix A (and the number of rows of matrix B), and P is the number of columns of matrix B.
The next M lines each contain N integers representing the rows of matrix A.
The following N lines each contain P integers representing the rows of matrix B.
outputFormat
Output the resulting matrix C in M lines. Each line should contain P space-separated integers representing a row of the resulting matrix.
## sample2 3 2
1 2 3
4 5 6
7 8
9 10
11 12
58 64
139 154
</p>