3360: A Multiply Problem

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:52 解决:23

题目描述

Our problem is,for a giving M rows and M columns matrix A,output another matrix B=AN.

输入

There are multiple test cases. The first line of the input contains an integer T, meaning the number of the test cases.
For each test cases, there are two integers M and N in a single line.
You can assume that 1<=M<=4,,0<=N<=4.

Then,M row M column integers value v followed.The ith row and jth column v represent a the ith row and jth column of matrix A.You can assume that for each v, -10<=v<=10.

输出

For each testcase,first output the case number in a single line.Then,output M rows M columns integers represent the matrix B.

Each line of the output should contain M integers and these M integers should be separated by blank spaces.You must know no blank space after the last integer of each line.

样例输入 复制

1
2 2
9 7
5 1

样例输出 复制

Case 1:
116 70
50 36

来源/分类