Multiply Matrices
Submissions: 8014   Accuracy:

39.07%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

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 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.