13297 - Learning Matrix   

Description

"We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy

I just wanna tell you how I'm feeling
Gotta make you understand
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
"

~ 《Never Gonna Give You Up》

 

In this problem, given 2 matrix, A[N, M] and B[M, N]. You are asked to calculate C = (A x B)(the transpoed matrix of A multiplies B).

 

How to calculate A x B:

How to transpose a matrix:

 

Note that every elements in A, B, and C can be represented by datatype int.

Input

There are three parts of the input:

(1)1<=N<=2100

(2)1<=M<=2100

(3)A[N,M] and B[M,N] separated by a newline charcter. -100<=The values in the matrix<=100.

Output

C = (A x B)(the transpoed matrix of A multiplies B).

Note that you have to print whitespaces between each elements and a newline character in the end of each rows.

Sample Input  Download

Sample Output  Download

Tags




Discuss