Problem:


  MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});

Matrix Multiplication

Write a program which reads a $n \times m$ matrix $A$ and a $m \times l$ matrix $B$, and prints their product, a $n \times l$ matrix $C$. An element of matrix $C$ is obtained by the following formula:

\[
c_{ij} = \sum_{k=1}^m a_{ik}b_{kj}
\]

  where $a_{ij}$, $b_{ij}$ and $c_{ij}$ are elements of $A$, $B$ and $C$ respectively.

Input

  In the first line, three integers $n$, $m$ and $l$ are given separated by space characters

  In the following lines, the $n \times m$ matrix $A$ and the $m \times l$ matrix $B$ are given.

Output

  Print elements of the $n \times l$ matrix $C$ ($c_{ij}$). Print a single space character between adjacent elements.

Constraints

$1 \leq n, m, l \leq 100$

$0 \leq a_{ij}, b_{ij} \leq 10000$

Sample Input

3 2 3
1 2
0 3
4 5
1 2 1
0 3 2

Sample Output

1 8 5
0 9 6
4 23 14

Note

      解説      

	



Sample input:
3 2 3
1 2
0 3
4 5
1 2 1
0 3 2


Sample output:
1 8 5
0 9 6
4 23 14

Submission status: Runtime Error

Solution code:
n,m,l=map(int,input().split())
A=[list(map(int,input().split())) for i in range(n)]
B=[list(map(int,input().split())) for i in range(m)]
C=[[0]*l for i in range(n)]

for x in range(n):
    for y in range(m):
        for z in range(l):
            C[x][y] += A[x][z]*B[z][y]

for row in range(n):
    print("%d"%(C[row][0]),end="")
    for col in range(1,l):
        print(" %d"%(C[row][col]),end="")
    print()

Submission status: Runtime Error

Solution code:
n1,n2,n3 = map(int,input().split(" "))

list1 = [list(map(int,input().split(" "))) for _ in range(n1)]
list2 = [list(map(int,input().split(" "))) for _ in range(n2)]

mat = [[0 for _ in range(n1)] for _ in range(n3)]

for i in range(n1):
	for j in range(n2):
		for k in range(n3):
			mat[i][k] += list1[i][j] * list2[j][k]

for m in mat:
	print(*m)

Submission status: Runtime Error

Solution code:
n, m, l = map(int, input().split())
a = [input().split()for _ in range(n)]
b = [input().split()for _ in rnage(m)]     

for i in range(n):
    for j in range(l):
        for k in range(m):
            c[i][l] = int(a[i][k])*int(b[k][j])
for i in range(n):
    print(*c)

Submission status: Runtime Error

Solution code:
n, m, l = map(int, input().split())
a = [input().split()for _ in range(n)]
b = [input().split()for _ in rnage(m)]     

for i in range(n):
    for j in range(l):
        for k in range(m):
            c[i][j] = int(a[i][k])*int(b[k][j])
for i in range(n):
    print(*c)

Submission status: Runtime Error

Solution code:
n, m, l = map(int, input().split())
a = [input().split()for _ in range(n)]
b = [input().split()for _ in rnage(m)]     
c = [[0]*l for _ in range(n)]
for i in range(n):
    for j in range(l):
        for k in range(m):
            c[i][j] = int(a[i][k])*int(b[k][j])
for i in range(n):
    print(*c)

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;
 
int main() {
  int n, m, l, a[110][110] = {0}, b[110][110] = {0};
  long long c[110][110] = {0};
  cin >> n >> m >> l;
  for (int i=0;i<n;i++)
    for (int j=0;j<m;j++)
      cin >> a[i][j];
  for (int i=0;i<m;i++)
    for (int j=0;j<l;j++)
      cin >> b[i][j];
 
  for (int i=0;i<n;i++)
    for (int j=0;j<l;j++)
      for (int k=0;k<m;k++)
        c[i][j] += a[i][k] * b[k][j];
  for (int i=0;i<n;i++) {
    for (int j=0;j<l-1;j++)
      cout << c[i][j] << " ";
    cout << c[i][l-1] << endl;
  }
}

Submission status: Runtime Error

Solution code:
while True:
  m,f,r = map(int, input().split())
  if m==-1 and f==-1 and r==-1:
    break
 
  if m==-1 or f==-1:
    print('F')
  elif m+f>=80:
    print('A')
  elif 65<=m+f:
    print('B')
  elif 50<=m+f:
    print('C')  
  elif 30<=m+f:
    if r>=50:
      print('C')
    else:
      print('D')
  else:
    print('F')

Submission status: Runtime Error

Solution code:
import numpy as np
n, m, l = list(map(int, input().split()))
a = np.array([[int(j) for j in input().split()] for i in range(n)])
b = np.array([[int(j) for j in input().split()] for i in range(m)])
c = np.dot(a, b)

length = [len(x) for x in c]

for i in range(len(c)):
    for j in range(length[0]):
        print(c[i][j], end='')
        if (length[0]-1) != j:
            print(' ', end='')
    print('\n', end='')

Submission status: Runtime Error

Solution code:
n, m, l = list(map(int, input().split()))
a = [[int(j) for j in input().split()] for i in range(n)]
b = [[int(j) for j in input().split()] for i in range(m)]
c = [[0 for j in range(n)] for i in range(l)]

for i in range(n):
    for j in range(l):
        value = 0
        for k in range(m):
            value = value + a[i][k] * b[k][j]
        c[i][j] = value

for i in c:
    print(*i)

Submission status: Runtime Error

Solution code:
n,m,l = map(int,input().split())
a = [[0]*m for i in range(n)]
b = [[0]*l for i in range(m)]
c = []
for i in range(n):
    a[i] = list(map(int,input().split()))

for i in range(m):
    b[i] = list(map(int,input().split()))

for k,v in a:
    tmp = []
    for kk,vv in zip(*b):
        tmp.append(k * kk + v * vv)
    c.append(tmp)

for i in range(n):
    for j in range(l):
        print("%d" %c[i][j],end="")
        if(j < l-1): print(" ",end="")
        else: print()

Submission status: Runtime Error

Solution code:
n, m, l = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
B = [list(map(int, input().split())) for i in range(m)]

C = [[0] * n for i in range(l)]

for i in range(l):
    for j in range(n):
        C[i][j] = str(sum(A[i][k] * B[k][j] for k in range(m)))

for i in range(l):
    print(' '.join(C[i]))

Submission status: Runtime Error

Solution code:

(n, m, l) = map(int, raw_input().split())

A = []
for i in xrange(0,n):
	line_A = map(int, raw_input().split())
	A.append(line_A)

B = []
for j in xrange(0,m):
	line_B = map(int, raw_input().split())
	B.append(line_B)

C = []
for x in xrange(0,n):
	temp_list = []
	for y in xrange(0,l):
		temp = 0
		for z in xrange(0,m):
			temp = temp + A[x][z] * B[z][y]

		temp_list.append(temp)
		
	C.append(temp_list)
	temp_list = []
			

for k in xrange(0,n):
	if k > 0:
		print
	for h in xrange(0,l):

Submission status: Runtime Error

Solution code:
n, m, l = list(map(lambda x: int(x), input().split(" ")))
A = list()
for i in range(n):
    A.extend([list(map(lambda x: int(x), input().split(" ")))])
B = list()
for i in range(m):
    B.extend([list(map(lambda x: int(x), input().split(" ")))])
C = list([[0 for n_ in range(n)]for l_ in range(l)])
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]
for a in C:
    print("%d" % a[0], end="")
    for b in a[1:]:
        print(" %d" % b, end="")
    print()

Submission status: Runtime Error

Solution code:
n,m,l = map(int,raw_input().split())
nm = []
ml = []
result = []
for a in range(n):
    nm.append(map(int,raw_input().split()))
for b in range(m):
    ml.append(map(int,raw_input().split()))

result = [ [0 for a in range(n)] for b in range(l) ]

for i in range(n):
    for j in range(l):
        for k in range(m):
            result[i][j] += nm[i][k] * ml[k][j]

for seq in result:
    print " ".join(map(str,seq))

Submission status: Runtime Error

Solution code:

n,m,l = [int(x) for x in raw_input().split()]

A = []
for idx in range(0,n):
    A.append([int(x) for x in raw_input().split()])

B = []
for idx in range(0,m):
    B.append([int(x) for x in raw_input().split()])

for line in range(0, n):
    result_list = []
    for idx1 in range(0, l):
        sum = 0
        for idx2 in range(0, m):
            sum += A[line][idx2] * B[idx2][idx1]
        result_list.append(sum)
    
    result_str = ""
    for result in result_list:
        result_str += str(result) + " "
    print result_str

Submission status: Runtime Error

Solution code:
import numpy as np

(n, m, l) = [int(i) for i in input().split()]

A = []
for nc in range(n):
    A.append([int(i) for i in input().split()])

B = []
for mc in range(m):
    B.append([int(i) for i in input().split()])

product = np.dot(A,B)

for nc in range(n):
    for lc in range(l):
        if lc == l - 1:
            print(product[nc][lc])
        else:
            print(product[nc][lc], '', end='')

Submission status: Runtime Error

Solution code:
(n, m, l) = [int(i) for i in input().split()]

A = []
for nc in range(n):
    A.append([int(i) for i in input().split()])

B = []
for mc in range(m):
    B.append([int(i) for i in input().split()])

product = np.dot(A,B)

for nc in range(n):
    for lc in range(l):
        if lc == l - 1:
            print(product[nc][lc])
        else:
            print(product[nc][lc], '', end='')

Submission status: Runtime Error

Solution code:
(n, m, l) = [int(i) for i in input().split()]

A = []
for nc in range(n):
    A.append([int(i) for i in input().split()])

B = []
for mc in range(m):
    B.append([int(i) for i in input().split()])

product = []

for nc in range(n):
    for lc in range(l):
        if lc == l - 1:
            print(product[nc][lc])
        else:
            print(product[nc][lc], '', end='')

Submission status: Runtime Error

Solution code:
n,m,l=map(int,input().split())

a=[list(map(int,input().split()))  for i range(n)]

b=[list(map(int,input().split()))  for i range(m)]

c=[[0 for k range(n)] for j range(l)]

for i in range(n):
  for j in range(l):
   for k in range(m):
    c[i][j] += a[i][k]*b[k][j]


for i in range(n):
  for j in range(l):
    print(c[i][j])

Submission status: Runtime Error

Solution code:
n,m,l=map(int,input().split())

a=[list(map(int,input().split()))  for i range(n)]

b=[list(map(int,input().split()))  for i range(m)]

c=[[0 for k range(n)] for j range(l)]

for i in range(n):
  for j in range(l):
   for k in range(m):
    c[i][j] += a[i][k]*b[k][j]


for i in range(n):
  for j in range(l):
    print(c[i][j] )

Submission status: Runtime Error

Solution code:
n,m,l=map(int,raw_input().split())
matA=[map(int,raw_input().split()) for i in range(m)]
matB=[map(int,raw_input().split()) for j in range(l)]
for i in range(n):
	for j in range(l):
		print sum([A[i][k]*B[k][j] for k in range(m)]),
	print

Submission status: Runtime Error

Solution code:
(n, m, l) = [int(i) for i in input().split()]
A = []
for nc in range(n): 
    A.append([int(i) for i in input().split()])
B = []
for mc in range(m): 
    B.append([int(i) for i in input().split()])

product = [[0 for d in range(l)] for dd in range()]
      
for nc in range(n):
    for lc in range(l): 
        for mc range(m):
            product[nc][lc] += A[nc][mc] * B[mc][lc] 

for r in product: 
    print(' '.join([str(d) for d in r]))

Submission status: Runtime Error

Solution code:
(n, m, l) = [int(i) for i in input().split()]
A = []
for nc in range(n): 
    A.append([int(i) for i in input().split()])
B = []
for mc in range(m): 
    B.append([int(i) for i in input().split()])

product = [[0 for d in range(l)] for dd in range()]
      
for nc in range(n):
    for lc in range(l): 
        for mc in range(m):
            product[nc][lc] += A[nc][mc] * B[mc][lc] 

for r in product: 
    print(' '.join([str(d) for d in r]))

Submission status: Runtime Error

Solution code:
  n, m, L = map(int, input().split())
 
a = [list(map(int, input().split())) for _ in range(n)]
b = [list(map(int, input().split())) for _ in range(m)]
c = [[sum(ak * bk for ak, bk in zip(ai,bj)) for bj in zip(*b)] for ai in a]
 
for ci in c:
    print(*ci)

Submission status: Runtime Error

Solution code:
(n, m, l) = [int(i) for i in input().split()]
A = []
for nc in range(n): 
????????A.append([int(i) for i in input().split()])
B = []
for mc in range(m): 
????????B.append([int(i) for i in input().split()])
??
product = [[0 for d in range(l)] for dd in range(n)]
??????????????
for nc in range(n):
????????for lc in range(l): 
????????????????for mc in range(m):
????????????????????????product[nc][lc] += A[nc][mc] * B[mc][lc] 
??
for r in product: 
????????print(' '.join([str(d) for d in r]))

Submission status: Runtime Error

Solution code:
nml = input().split()
n, m, l = map(int, nml)

A = [[int(i) for i in input().split()] for j in range(n)]
B = [[int(i) for i in input().split()] for j in range(m)]

C = [[0 for i in range(l)] for j in range(n)]

for j in range(n):
    for i in range(l):
        s = 0
        for k in range(m):
            s += A[i][k]*B[k][j]
        C[i][j] = s

for i in C:
    print(' '.join(map(str, i)))

Submission status: Runtime Error

Solution code:
nml = input().split()
n, m, l = map(int, nml)

A = [[int(i) for i in input().split()] for j in range(n)]
B = [[int(i) for i in input().split()] for j in range(m)]

C = [[0 for i in range(l)] for j in range(n)]

for j in range(n):
    for i in range(l):
        s = 0
        for k in range(m):
            s += A[i][k]*B[k][j]
        C[j][i] = s

C = zip(*C)

for i in C:
    print(' '.join(map(str, i)))

Submission status: Runtime Error

Solution code:
n,m,l = map(int,raw_input().split())
a = [map(int,raw_input().split()) for _ in range(n)]
b = [map(int,raw_input().split()) for _ in range(m)]
c = [[0 for i in range(n)] for j in range(l)]

for i in range(n):
    for j in range(l):
        s = 0
        for k in range(m):
            s += a[i][k] * b[k][j]
        c[i][j] = s

for i in range(n):
    print ' '.join(map(str,c[i]))

Submission status: Runtime Error

Solution code:
import sys

n, m, l = map(int, raw_input().split())
a = []
b = []
for i in range(n):
	a.append(map(int, raw_input().split()))
for i in range(m):
	b.append(map(int, raw_input().split()))

c = [[0 for i in xrange(n)] for j in xrange(l)]

for i in xrange(n):
	for j in xrange(l):
		for k in xrange(m):
			c[i][j] += a[i][k] * b[k][j]

for i in xrange(n):
	for j in xrange(l-1):
		sys.stdout.write(str(c[i][j])+" ")
	print c[i][l-1]

Submission status: Runtime Error

Solution code:
import numpy as np
import sys

n, m, l = map(int, raw_input().split())
a = []
b = []
for i in range(n):
	a.append(map(int, raw_input().split()))
for i in range(m):
	b.append(map(int, raw_input().split()))

a = np.matrix(a)
b = np.matrix(b)

c = a * b

for i in xrange(n):
	for j in xrange(l-1):
		sys.stdout.write(str(c[i,j])+" ")
	print c[i,l-1]

Submission status: Runtime Error

Solution code:
import numpy as np

n, m, l = map(int, input().split())

a = np.matrix(';'.join([input() for i in range(n)]))
b = np.matrix(';'.join([input() for i in range(m)]))
c = a * b

for i in range(n):
    print(' '.join(map(str, c.tolist()[i])))

Submission status: Runtime Error

Solution code:
n, m, L = map(int, input().split))

a = [list(map(int, input().split())) for _in range(n)]
b = [list(map(int, input().split())) for _in range(m)]
c = [[sum(ak * bk for ak, bk in zip(ai, bj)) for bj in zip(*b)] for ai in a]

for ci in c:
    print(*ci)

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
array = [[0 for i in range(n)] for j in range(l)]

#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)

for i in range(m):
    swap_list = input().split()
    B.append(swap_list)

#?????????????????????
for i in range(n):
    for j in range(l):
        for k in range(m):
            array[i][j] += int(A[i][k]) * int(B[k][j])

#?????????????????????
for i in range(n):
    print(" ".join(map(str,array[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
array = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)
#?????????????????????
for i in range(n):
    for j in range(l):
        for k in range(m):
            array[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
for i in range(n):
    print(" ".join(map(str,array[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
C = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)
#?????????????????????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
for i in range(n):
    print(" ".join(map(str,C[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
C = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)

#?????????????????????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
for i in range(n):
    print(" ".join(map(str,C[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
C = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)

#?????????????????????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
for i in range(n):
    print(" ".join(map(str, C[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
C = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)

#?????????????????????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
for i in range(0,n):
    print(" ".join(map(str, C[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
#C = [[0] * n] * l
C = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)

#?????????????????????
for i in range(0,n):
    for j in range(0,l):
        for k in range(0,m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
for i in range(0,n):
    print(" ".join(map(str, C[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
#C = [[0] * n] * l
C = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(0,n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(0,m):
    swap_list = input().split()
    B.append(swap_list)

#?????????????????????
for i in range(0,n):
    for j in range(0,l):
        for k in range(0,m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
for i in range(0,n):
    print(" ".join(map(str, C[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
#C = [[0] * n] * l
C = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)

#????????????????¨????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
#for i in range(n):
#    for j in range(l):
#        print("{0}".format(C[i][j]), end="\b")
#    print("")
for i in range(n):
    print(" ".join(map(str, C[i][:])))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
#C = [[0] * n] * l
C = [[0 for i in range(n)] for j in range(l)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)

#????????????????¨????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
#for i in range(n):
#    for j in range(l):
#        print("{0}".format(C[i][j]), end="\b")
#    print("")
#for i in range(n):
#    print(" ".join(map(str, C[i][:])))
for r in C:
    print(' '.join([str(d) for d in r]))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
#C = [[0] * n] * l
C = [[0 for i in range(n)] for j in range(l)]
product = [[0 for d in range(l)] for dd in range(n)]
#??\?????????????????????????´?
for i in range(n):
    #swap_list = input().split()
    #A.append(swap_list)
    A.append([int(i) for i in input().split()])
for i in range(m):
    #swap_list = input().split()
    #B.append(swap_list)
    B.append([int(i) for i in input().split()])
#????????????????¨????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
#for i in range(n):
#    for j in range(l):
#        print("{0}".format(C[i][j]), end="\b")
#    print("")
#for i in range(n):
#    print(" ".join(map(str, C[i][:])))
for r in C:
    print(' '.join([str(d) for d in r]))

Submission status: Runtime Error

Solution code:
n, m, l = (int(i) for i in input().split())
A = []
B = []
#C = [[0] * n] * l
C = [[0 for i in range(n)] for j in range(l)]

#??\?????????????????????????´?
for i in range(n):
    #swap_list = input().split()
    #A.append(swap_list)
    A.append([int(i) for i in input().split()])
for i in range(m):
    #swap_list = input().split()
    #B.append(swap_list)
    B.append([int(i) for i in input().split()])
#????????????????¨????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]
#?????????????????????
#for i in range(n):
#    for j in range(l):
#        print("{0}".format(C[i][j]), end="\b")
#    print("")
#for i in range(n):
#    print(" ".join(map(str, C[i][:])))
for r in C:
    print(' '.join([str(d) for d in r]))

Submission status: Runtime Error

Solution code:
# ????????????
n,m,l = list(map(int,input().split()))
matrixA,matrixB = [],[]
for i in range(n):
	matrixA.append(list(map(int,input().split())))
for j in range(m):
	matrixB.append(list(map(int,input().split())))

matrix = []
for i in range(l):
	mtr = []
	for j in range(m):
		mtr.append(matrixB[j][i])
	matrix.append(mtr)

matrixC = []
for i in range(l):
	mtr = []
	for j in range(n):
		num_sum = 0
		# print(matrixA[j],matrix[i])
		for a,b in zip(matrixA[j],matrix[i]):
			num_sum += a*b
		mtr.append(num_sum)
	matrixC.append(mtr)

matrix = []
for i in range(l):
	out = ''
	for j in range(n):
		out += str(matrixC[j][i]) + ' '
	print(out[:-1])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n,m,l = [int(i)for i in input().split(' ')]
A = []
B = []
C = [[0for _ in range(n)]for _ in range(l)]
for i in range(n):
    A.append([int(a)for a in input().split(' ')])
for i in range(m):
    B.append([int(a)for a in input().split(' ')])

for i in range(n):
    for j in range(l):
        s = 0
        for k in range(m):
            s += A[i][k]*B[k][j]
        C[i][j] = s

for x in range(l):
    print(' '.join([str(a)for a in C[x]]))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n,m,l = [int(i)for i in input().split(' ')]
A = []
B = []
C = [[0for _ in range(n)]for _ in range(l)]
for i in range(n):
    A.append([int(a)for a in input().split(' ')])
for i in range(m):
    B.append([int(a)for a in input().split(' ')])

for i in range(n):
    for j in range(l):
        s = 0
        for k in range(m):
            s += A[i][k]*B[k][j]
        C[i][j] = s

for x in range(n):
    print(' '.join([str(a)for a in C[x]]))

Submission status: Runtime Error

Solution code:
n,m,l = map(int,input().split())
a = []
b = []
for _ in range(n):
    a.append(list(map(int,input().split())))
for _ in range(m):
    b.append(list(map(int,input().split())))
c = [[0 for _ in range(n)] for _ in range(l)]

for i in range(n):
    for j in range(m):
        for k in range(l):
            c[i][k] += a[i][j]*b[j][k]

for i in c:
    print(" ".join(list(map(str,i))))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]
c = [[0] * l for _ in range(n)]

A = [(int(i) for i in input().split()) for i in range(n)]
B = [(int(i) for i in input().split()) for i in range(m)]
C = [(A + B)]

for ni in range(n):
    A.append([int(i) for i in input().split()])
    c[n][m] = sum([A[n][m] * B[m][l] for m in range(m)])
    

for mi in range(m):
    B.append([int(i) for i in input().split()])
    for c in (n, m, l):
        print(" ".join([str(v) for v in c]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = [[int(i) for i in input().split()]]
B = [[int(i) for i in input().split()]]
C = [(A + B)]


for ni in range(n):
    A.append([int(i) for i in input().split()])
    C[n][m] = sum([A[n][m] * B[m][l] for m in range(m)])


for mi in range(m):
    B.append([int(i) for i in input().split()])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = [[int(i) for i in input().split()]]
B = [[int(i) for i in input().split()]]
C = []


for ni in range(n):
    A.append([int(i) for i in input().split()])
    C[n][m] = sum([A[n][m] * B[m][l] for m in range(m)])


for mi in range(m):
    B.append([int(i) for i in input().split()])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []


for ni in range(n):
    A.append([int(i) for i in input().split()])
    C[n][m] = sum([A[n][m] * B[m][l] for m in range(m)])


for mi in range(m):
    B.append([int(i) for i in input().split()])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []


for ni in range(n):
    A.append([int(i) for i in input().split()])
    C[n][m] = sum([A[n][l] * B[m][l] for m in range()])


for mi in range(m):
    B.append([int(i) for i in input().split()])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []


for ni in range(n):
    A.append([int(i) for i in input().split()])
    C[n][m] = sum([A[n][l] * B[m][l] for m in range(l)])


for mi in range(m):
    B.append([int(i) for i in input().split()])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = [input(range(n))]
B = [input(range(m))]
C = [[0] * 1 for n in range(n)]


for ni in range(n):
    A.append([int(i) for i in input().split()])
    C[n][m] = sum([A[n][l] * B[m][l] for m in range(l)])


for mi in range(m):
    B.append([int(i) for i in input().split()])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = [input(range(n))]
B = [input(range(m))]
C = [[0] * 1 for n in range(n)]


for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])
    
C[n][m] = sum([A[n][l] * B[l][m] for l in range(l)])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = [input(range(n))]
B = [input(range(m))]
C = [[0] * 1 for n in range(n)]


for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

C[n][m] = sum([A[n][l] * B[l][m] for l in range(m)])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = [input(range(n))]
B = [input(range(m))]
C = [[0] * 1 for n in range(n)]


for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

C[n][m] = sum([A[n][l] * B[l][m]])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = [input(range(n))]
B = [input(range(m))]
C = [[0] * 1 for n in range(n)]


for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

C[A][B] = sum([A[n][l] * B[l][m]])

print(" ".join([str(v) for v in C]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        c.append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

from  pprint import pprint
pprint(c)

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(l):
    print(" ".join(C[li]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([int(i) for i in input().split()])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]
            
for li in range(l):
    print(" ".join(C[li]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(l):
    print(" ".join([str(s) for s in C[li]]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []


for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(l):
    print(" ".join([str(s) for s in C[li]]))

Submission status: Runtime Error

Solution code:
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(l):
     print(" ".join([str(s) for s in C[li]]))