10330 - Matrix Multiplication   

Description

Compute C=AB, where A is a matrix of size m×n, B is a matrix of size n×p, and C is a matrix of size m×p.

Input

 

First line contains a positive integer t (t <= 100), which indicates the numbers of test cases in the input. The first line of each test case contains three positive integers m, n, p (m, n, p <= 100) for the dimension of matrices. In the next m lines, each line contains n integers, representing the elements of matrix A. Followed by n lines, each line containing p integers, represent the elements of matrix B. All elements of A and B are 32-bit signed integers.


Case 1: m, n, p <=5
Case 2: m, n, p <=10
Case 3: m, n, p <=50
Case 4: m, n, p <=100

 

Output

For each case, output an m*p matrix in m lines and each line contains p integers.
Use one space between two consecutive integers. Output a blank line between each case.

Sample Input  Download

Sample Output  Download

Tags




Discuss