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

73 人解决,112 人已尝试。

92 份提交通过,共有 309 份提交。

4.2 EMB 奖励。

创建: 11 年,9 月前.

修改: 3 年前.

最后提交: 2 月,3 周前.

来源: ECNU 选拔 2008

题目标签