#D6344. Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Write a program which reads a matrix and a matrix , and prints their product, a matrix . An element of matrix is obtained by the following formula:
\[ c_{ij} = \sum_{k=1}^m a_{ik}b_{kj} \]
where , and are elements of , and respectively.
Note
解説
Constraints
Input
In the first line, three integers , and are given separated by space characters
In the following lines, the matrix and the matrix are given.
Output
Print elements of the matrix (). Print a single space character between adjacent elements.
Example
Input
3 2 3 1 2 0 3 4 5 1 2 1 0 3 2
Output
1 8 5 0 9 6 4 23 14
inputFormat
Input
In the first line, three integers , and are given separated by space characters
In the following lines, the matrix and the matrix are given.
outputFormat
Output
Print elements of the matrix (). Print a single space character between adjacent elements.
Example
Input
3 2 3 1 2 0 3 4 5 1 2 1 0 3 2
Output
1 8 5 0 9 6 4 23 14
样例
3 2 3
1 2
0 3
4 5
1 2 1
0 3 2
1 8 5
0 9 6
4 23 14
</p>