2429. Matrix

单点时限: 2.0 sec

内存限制: 256 MB

Your task is to calculate the multiplication of given two matrixes.

输入格式

Input will consist of N(0<N<=20) test cases. Each test case consists of two matrixes. One matrix consits of two part. First part consists from one line which contains two positive integers R <= 100 and C <= 100. R means row number and C means column number. Second part consists from R lines which contains C integers. These integers compose matrix (Row-Column order).

You can assume that all inputs are valid and can calculate the multiplication.

输出格式

Output the result of multiplication like sample output. After each test case, you should output a blank line.

样例

Input
3
2 2
1 1
1 1
2 2
1 0
0 1
3 2
1 1
1 1
1 1
2 3
1 1 1
1 1 1
2 2
1 3
4 5
2 2
3 5
2 4
Output
1 1
1 1
2 2 2
2 2 2
2 2 2
9 17
22 40

110 人解决,152 人已尝试。

144 份提交通过,共有 502 份提交。

3.6 EMB 奖励。

创建: 15 年,11 月前.

修改: 7 年,2 月前.

最后提交: 1 年,3 月前.

来源: ECNU 选拔 2008

题目标签