Multiply Matrices
School Accuracy: 48.41% Submissions: 11013 Points: 0

Given two square Matrices A[][] and B[][]. Your task is to complete the function multiply which stores the multiplied matrices in a new matrix C[][].
 

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer N denoting the size of the square
matrix . Then in the next two lines are N*N space separated values of the matrix A[][] and B[][].
 

Output:
For each test case in a new line output will be 
the space separated values of the matrix C[][].
 

Constraints:
1 <=T<= 100
1 <= N <= 20

 

Example(To be used for the expected output):
Input:
2
2
7 18 2 9 
14 5 5 18 
2
17 4 17 16 
9 2 7 1 
Output:
188 359 73 172 
181 38 265 50 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Output Window