Given two matrices $A$, $B$ with size $n \times m$ and $m \times p$ respectively, where
$
A_{n\times m} = \begin{bmatrix}
a_{11} & a_{12} & \dots & a_{1m} \\
a_{21} & a_{22} & \dots & a_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \dots & a_{nm}
\end{bmatrix}
,\ B_{m\times p} = \begin{bmatrix}
b_{11} & b_{12} & \dots & b_{1p} \\
b_{21} & b_{22} & \dots & b_{2p} \\
\vdots & \vdots & \ddots & \vdots \\
b_{m1} & b_{m2} & \dots & b_{mp}
\end{bmatrix}
$
The result of multiplication of $A$ and $B$ is a matrix with size $n \times p$, where each element
$
ab_{ij} = \displaystyle \sum_{k=1} ^ {m} a_{ik} b_{kj}
,$ for $1 \leq i \leq n$ and $1 \leq j \leq p$
The first line contains three integers representing $n $, $m$ and $p$ $(1 \leq n, m, p \leq 100)$,
and is followed by $n + m$ lines: the first $n$ lines represent matrix $A$, and the other $m$ lines are for matrix $B$. $(0 \leq a_{ij}, b_{ij} \leq 1000)$
$n$ lines with $p$ elements in each line, representing the result of multiplication of $A$ and $B$.
In the sample,
$
A = \begin{bmatrix}
1 & 2 & 3 \\
2 & 4 & 5 \\
\end{bmatrix}
,\ B = \begin{bmatrix}
1 & 3 \\
2 & 4 \\
4 & 2 \\
\end{bmatrix}
$
No. | Testdata Range | Score |
---|---|---|
1 | 0~5 | 10 |
No. | Time Limit (ms) | Memory Limit (KiB) | Output Limit (KiB) | Subtasks |
---|---|---|---|---|
0 | 1000 | 65536 | 65536 | |
1 | 1000 | 65536 | 65536 | |
2 | 1000 | 65536 | 65536 | |
3 | 1000 | 65536 | 65536 | |
4 | 1000 | 65536 | 65536 | |
5 | 1000 | 65536 | 65536 |