qyliang/CodeNanoFix huggingface dataset:
Buggy code:
notice = int(input())
record = [[[0] * 10 for i in range(3)] for j in range(4)]

for _ in range(notice):
    b, f, r, v = map(int, input().split())
    record[b-1][f-1][r-1] += v

ans = ('\n' + '#' * 20 + '\n').join([ '\n'.join([' '.join(map(str, floor)) for floor in building]) for building in record])
print(ans)


Fixed code:
notice = int(input())
record = [[[0] * 10 for i in range(3)] for j in range(4)]

for _ in range(notice):
    b, f, r, v = map(int, input().split())
    record[b-1][f-1][r-1] += v

ans = ('\n' + '#' * 20 + '\n').join([ '\n'.join([' ' + ' '.join(map(str, floor)) for floor in building]) for building in record])
print(ans)
Buggy code:
# Official House

n = int(input())
houses = 4
floors = 3
rooms = 10

official = [[[0 for k in range(rooms)] for j in range(floors)] for i in range(houses)]
print(official)

for a in range(n):
    info = [int(x) for x in input().rstrip().split()]
    b = info[0] - 1
    f = info[1] - 1
    r = info[2] - 1
    v = info[3]
    currentFloor = official[b][f]
    print(currentFloor)
    currentFloor[r] += v

print(official)

for i in range(houses):
    for j in range(floors):
        for k in range(rooms):
            print(' ' + official[i][j][k], end = '')
    if i < houses - 1:
        print('#' * 20)



Fixed code:
# Official House

n = int(input())
houses = 4
floors = 3
rooms = 10

official = [[[0 for k in range(rooms)] for j in range(floors)] for i in range(houses)]
# print(official)

for a in range(n):
    info = [int(x) for x in input().rstrip().split()]
    b = info[0] - 1
    f = info[1] - 1
    r = info[2] - 1
    v = info[3]
    currentFloor = official[b][f]
    # print(currentFloor)
    currentFloor[r] += v

# print(official)

for i in range(houses):
    for j in range(floors):
        for k in range(rooms):
            print(' ' + str(official[i][j][k]), end = '')
        print()
    if i < houses - 1:
        print('#' * 20)
Buggy code:
A = []
for _ in range(12):
        A.append([0]*10)

n = int(input())
for _ in range(n):
        b, f, r, v = map(int, input().split())
        A[3*b-(3-f)-1][r-1] += v

for i in range(12):
        
        if i in [2, 5, 8]:
                print('#'*20)
        else:
                print(' ', end='')
                print(' '.join(map(str, A[i])))


Fixed code:
A = []
for _ in range(12):
	A.append([0]*10)

n = int(input())
for _ in range(n):
	b, f, r, v = map(int, input().split())
	A[3*b-(3-f)-1][r-1] += v

for i in range(12):        
	print(' ', end='')
	print(' '.join(map(str, A[i])))
	if i in [2, 5, 8]:
		print('#'*20)
Buggy code:
def main():

    m, n = tuple(map(int, input().split()))
    a = [[0 for j in range(n)] for i in range(m)]
    b = [0 for j in range(n)]
    c = [0 for i in range(m)]

    for i in range(m):
        tmplst = list(map(int, input().split()))
        for j in range(n):
            a[i][j] = tmplst[j]

    for j in range(n):
        b[j] = int(input())

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



if __name__ == '__main__':
    main()


Fixed code:
def main():

    m, n = tuple(map(int, input().split()))
    a = [[0 for j in range(n)] for i in range(m)]
    b = [0 for j in range(n)]
    c = [0 for i in range(m)]

    for i in range(m):
        tmplst = list(map(int, input().split()))
        for j in range(n):
            a[i][j] = tmplst[j]

    for j in range(n):
        b[j] = int(input())

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



if __name__ == '__main__':
    main()
Buggy code:
n,m=map(int,input().split())
lst=[[]for i in range(n)]
for i in range(n):
    lst[i]=list(map(int,input().split()))
lst2=[[]*1 for i in range(m)]
for i in range(m):
    lst2[i]=list(map(int,input().split()))
for i in range(n):
    x=0
    for j in range(m):
        x=x+lst[i][j]*lst2[j]
    print("%d"%(x))


Fixed code:
n,m=map(int,input().split())
lst=[[]for i in range(n)]
for i in range(n):
    lst[i]=list(map(int,input().split()))
lst2=[[]*1 for i in range(m)]
for i in range(m):
    lst2[i]=int(input())
for i in range(n):
    x=0
    for j in range(m):
        x=x+lst[i][j]*lst2[j]
    print("%d"%(x))
Buggy code:
n, m = map(int, input().split())
n_l = []
ans = [0, 0, 0]

for _ in range(n):
    l = list(map(int, input().split()))
    n_l.append(l)
for x in range(m):
    p = int(input())
    for o in range(n):
        n_l[o] *= p
for i in n_l:
    print(sum(i))


Fixed code:
n, m = map(int, input().split())
n_l = []
ans = [0, 0, 0]

for _ in range(n):
    l = list(map(int, input().split()))
    n_l.append(l)
for x in range(m):
    p = int(input())
    for o in range(n):
        n_l[o][x] *= p
for i in n_l:
    print(sum(i))
Buggy code:
N,M = map(int,input().split())

n =  [[] for i in range(N)]

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

m = [ 0 for k in range(M)]

for k in range(M):
    m[k] = int(input())

for x in range(N):
    for y in range(M):
        a = n[x][y] * m[y]
    print(a)


Fixed code:
N,M = map(int,input().split())

n =  [[] for i in range(N)]

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

m = [ 0 for k in range(M)]

for k in range(M):
    m[k] = int(input())

for x in range(N):
    a = 0
    for y in range(M):
        a += n[x][y] * m[y]
    print(a)
Buggy code:
(n,m) = [int() 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(input()))
    
product = []
for nc in range(n):
    total = 0
    for mc in range(m):
        total += A[nc][mc] * b[mc]

    product.append(total)
    
[print(p) for p in product]

Fixed code:
n,m = [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 (input()))

product = []
for nc in range(n):
    total = 0
    for mc in range(m):
        total += A[nc][mc] * b[mc]

    product.append(total)

[print(p) for p in product]
Buggy code:
n, m = map(int, input().split())
A = []
B = []
for line in range(n):
    A.append(list(map(int, input().split())))
for line in range(m):
    B.append(int(input()))
print(A,B)

ret = []
for i in range(n):
    ret.append(sum(A[i][j] * B[j] for j in range(m)))
print('\n'.join(map(str, ret)))

Fixed code:
n, m = map(int, input().split())
A = []
B = []
for line in range(n):
    A.append(list(map(int, input().split())))
for line in range(m):
    B.append(int(input()))
#print(A,B)

ret = []
for i in range(n):
    ret.append(sum(A[i][j] * B[j] for j in range(m)))
print('\n'.join(map(str, ret)))
Buggy code:
n, m = [int(i) for i in input().split()]

matrix = []
for ni in range(n):
    matrix.append([int(a) for a in input().split()])

vector = []
for mi in range(m):
    vector.append(int(input()))



for ni in range(n):
    sum = 0
    for mi in range(m):
        sum += matrix[ni][mi] * vector[mi]


print(sum)

Fixed code:
n,m =[int(r) for r in input().split()]

matrix = []
for ni in range(n):
    matrix.append([int(a)for a in input().split()])

vector = []
for mi  in range(m):
    vector.append(int(input()))

for ni in range(n):

    sum = 0
    for mi in range(m):
        sum += matrix[ni][mi] * vector[mi]

    print(sum)
Buggy code:
a = []; b = []; c = []
n, m = map(int, input().split())

for i in range(n):
	row = map(int, input().split())
	a.append(list(row))

for j in range(m):
	col = int(input())
	b.append(col)

for k in range(n):
	temp = 0
	for l in range(m):
		temp += a[k][l] * b[l] 
	c.append(temp)

print(c)

Fixed code:
a = []; b = []; c = []
n, m = map(int, input().split())

for i in range(n):
	row = map(int, input().split())
	a.append(list(row))

for j in range(m):
	col = int(input())
	b.append(col)

for k in range(n):
	temp = 0
	for l in range(m):
		temp += a[k][l] * b[l] 
	c.append(temp)

for ind in range(n):
	print(c[ind])
Buggy code:
n, m = [int(i) for i in input().split()]

matrix = []
for ni in  range(n):
    matrix.append([int(a) for a in input().split()])

vector = []
for mi in range(m):
    vector.append(int(input()))

for ni in range(n):

    sum =0
    for mi in rannge(m):
        sum += matrix[ni][mi] * vector[mi]

        print(sum)

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

matrix = []
for ni in range(n):
    matrix.append([int(a) for a in input().split()])

vector = []
for mi in range(m):
    vector.append(int(input()))


b = []
for ni in range(n):
    sum = 0
    for mi in range(m):
        sum += matrix[ni][mi] * vector[mi]

    print(sum)
Buggy code:
n, m = map(int, input().split())
M1 = []
M2 = []
for i in range(n):
 M1.append(list(map(int, input().split())))

for i in range(m):
 M2.append(int(input()))

for i in range(n):
 c = 0
 for s in range(m):
  c += M1[i][s] + M2[s]
 print(c)

Fixed code:
n, m = map(int, input().split())
M1 = []
M2 = []
for i in range(n):
 M1.append(list(map(int, input().split())))

for i in range(m):
 M2.append(int(input()))

for i in range(n):
 c = 0
 for s in range(m):
  c += M1[i][s] * M2[s]
 print(c)
Buggy code:
row, col = map(int,input().split())

mat = [[0 for i2 in range(col)] for i1 in range(row)]
for i in range(row):
    mat[i] = list(map(float,input().split()))
vec = [0 for i in range(col)]
for i in range(col):
       vec[i] = float(input())

result = [0 for i in range(row)]
for i in range(row):
    for j in range(col):
        result[i] += mat[i][j]*vec[j]

for i in range(len(result)):
    print(result[i])

Fixed code:
row, col = map(int,input().split())

mat = [[0 for i2 in range(col)] for i1 in range(row)]
for i in range(row):
    mat[i] = list(map(float,input().split()))
vec = [0 for i in range(col)]
for i in range(col):
       vec[i] = float(input())

result = [0 for i in range(row)]
for i in range(row):
    for j in range(col):
        result[i] += mat[i][j]*vec[j]

for i in range(len(result)):
    print(int(result[i]))
Buggy code:
#!usr/bin/env python3

import sys


def main():
    m, n = [int(col_row) for col_row in sys.stdin.readline().split()]
    matrix = [[0 for col in range(m)] for row in range(n)]
    vector = [0 for col in range(m)]

    for row in range(n):
        lst = [int(element) for element in sys.stdin.readline().split()]
        for col in range(m):
            matrix[row][col] += lst[col]

    for row in range(m):
        lst = [int(element) for element in sys.stdin.readline().split()]
        vector[row] += lst[0]

    for row in range(n):
        sum_of_row = 0
        for col in range(m):
            sum_of_row += matrix[row][col] * vector[col]
        # res.append(sum_of_row)
        print(sum_of_row)


if __name__ == '__main__':
    main()

Fixed code:
#!usr/bin/env python3

import sys


def main():
    m, n = [int(col_row) for col_row in sys.stdin.readline().split()]
    matrix = [[0 for col in range(n)] for row in range(m)]
    vector = [0 for row in range(n)]

    for row in range(m):
        lst = [int(element) for element in sys.stdin.readline().split()]
        for col in range(n):
            matrix[row][col] += lst[col]

    for row in range(n):
        lst = [int(element) for element in sys.stdin.readline().split()]
        vector[row] += lst[0]

    for row in range(m):
        sum_of_row = 0
        for col in range(n):
            sum_of_row += matrix[row][col] * vector[col]
        print(sum_of_row)


if __name__ == '__main__':
    main()
Buggy code:
n, m = map(int, input().split())

Mat = []

for i in range(n):
	row = list(map(int, input().split()))
	Mat.append(row)

print(Mat)
b = []

for j in range(m):
	b.append(int(input()))

c = [0 for k in range(n)]

for l in range(n):
	for l2 in range(m):
		c[l] += (Mat[l][l2] * b[l2])
	print(c[l])

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

Mat = []

for i in range(n):
	row = list(map(int, input().split()))
	Mat.append(row)

b = []

for j in range(m):
	b.append(int(input()))

c = [0 for k in range(n)]

for l in range(n):
	for l2 in range(m):
		c[l] += (Mat[l][l2] * b[l2])
	print(c[l])
Buggy code:
n,m = map(int,input().split())

a_list = []
b_list = []
c_list = []

for a in range(n):
    a_list.append(list(map(int,input().split())))

for b in range(n):
    b_list.append(int(input()))

for c in range(n):
    c_list.append([])
    for d in range(m):
        c_list[c].append((a_list[c][d] * b_list[c]))

c_list = list(map(sum,c_list))

for c in c_list:
    print(c)

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

a_list = []
b_list = []
c_list = []

for a in range(n):
    a_list.append(list(map(int,input().split())))

for b in range(m):
    b_list.append(int(input()))

for c in range(n):
    c_list.append([])
    for d in range(m):
        c_list[c].append((a_list[c][d] * b_list[d]))

c_list = list(map(sum,c_list))

for c in c_list:
    print(c)
Buggy code:
# coding: utf-8
# Here your code !

def func():
    try:
        (n,m) = tuple( [ int(num) for num in input().rstrip().split(" ") ] )
        matrix = [ [int(num) for num in input().rstrip().split(" ")] for i in range(n) ]
        vector = [ int( input().rstrip() ) for i in range(m) ]
    except:
        return inputError()

    result = [ sum( [i*j for i in matrix[k] for j in vector] ) for k in range(n) ]  #matrix??¨vector?????????
    
    for num in result:
        print(num)
    
def inputError():
    print("input error")
    return -1

func()

Fixed code:
# coding: utf-8
# Here your code !

def func():
    try:
        (n,m) = tuple( [ int(num) for num in input().rstrip().split(" ") ] )
        matrix = [ [int(num) for num in input().rstrip().split(" ")] for i in range(n) ]
        vector = [ int( input().rstrip() ) for i in range(m) ]
    except:
        return inputError()

    result = [ sum( [ matrix[j][i]*vector[i] for i in range(m) ] ) for j in range(n)  ] #????????¨??????????????????

    for num in result:
        print(num)
    
def inputError():
    print("input error")
    return -1

func()
Buggy code:
n, m = [int (input().split(" ")]

a =[ [int(i) for i in input().split(" ")] for _ in range(n) ]
b =[]
for i in range(m):
    b.append( int(input()) )


for x in range(n):
    result = 0
    for y in range(m):
        result += a[x][y] * b[y]
    print(result)
    

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

a =[ [int(i) for i in input().split(" ")] for _ in range(n) ]
b =[]
for i in range(m):
    b.append( int(input()) )


for x in range(n):
    result = 0
    for y in range(m):
        result += a[x][y] * b[y]
    print(result)
Buggy code:
n,m=map(int,input().split())
b=[list(map(int,input().split())) for i in range(n)]
c =[int(input()) for j in range(m)]
[print([sum(d*e for d,e in zip(b[i],c))]) for i in range(n)]

Fixed code:
n,m=map(int,input().split())
b=[list(map(int,input().split())) for i in range(n)]
c =[int(input()) for j in range(m)]
[print(sum([d*e for d,e in zip(b[i],c)])) for i in range(n)]
Buggy code:
a1 = [input().split()]
m = int(a1[0][0])
n = int(a1[0][1])
a2 = [input().split() for i in range(m)]
a3 = [input().split() for i in range(n)]
i = 0
print(a2)
print(a3)
while i < m:
    sum = 0
    j = 0
    while j < n:
        s = int(a2[i][j]) * int(a3[j][0])
        sum += s
        j += 1
    print(sum)
    i += 1

Fixed code:
a1 = [input().split()]
m = int(a1[0][0])
n = int(a1[0][1])
a2 = [input().split() for i in range(m)]
a3 = [input().split() for i in range(n)]
i = 0
while i < m:
    sum = 0
    j = 0
    while j < n:
        s = int(a2[i][j]) * int(a3[j][0])
        sum += s
        j += 1
    print(sum)
    i += 1
Buggy code:
N, M=map(int, input().split())
mat = [[0 for m in range(M)]for n in range(N)]
vec = [0 for m in range(M)]

for n in range(N):
  mat[n] = list(map(int , input().split()))
for m in range(m):
  vec[m] = int(input())

c = 0
for n in range(N):
 for m in range(M):
  c += mat[n][m] * vec[m]
 print(c)
 c = 0

Fixed code:
N, M=map(int, input().split())
mat = [[0 for m in range(M)]for n in range(N)]
vec = [0 for m in range(M)]

for n in range(N):
  mat[n] = list(map(int , input().split()))
for m in range(M):
  vec[m] = int(input())

c = 0
for n in range(N):
 for m in range(M):
  c += mat[n][m] * vec[m]
 print(c)
 c = 0
Buggy code:
a, b = map(int,input().split())
A = [[]*b for i in range(a)]
B = [] * b

for i in range(a):
    A[i] = map(int,input().split())

for i in range(b):
    B[i] = int(input())

for i in range(a):
    s=0
    for j in range(b):
        s+=A[i][j]*B[j]
    print(s)

Fixed code:
a, b = map(int,input().split())
A = [[0]*b for i in range(a)]
B = [0] * b

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

for i in range(b):
    B[i] = int(input())

for i in range(a):
    s=0
    for j in range(b):
        s+=A[i][j]*B[j]
    print(s)
Buggy code:
data = list(map(int, list(input().split())))
row = data[0]
column = data[1]
matrix = [[0 for i in range(column)] for j in range(row)]
vector = [[0] for k in range(column)]
vector_multi = [[0] for l in range(row)]

for i in range(row):
    data_row = list(map(int, list(input().split())))
    print(data_row)
    for j in range(column):
        matrix[i][j] = data_row[j]

for i in range(column):
    vector[i] = int(input())

for i in range(row): 
    element = 0
    for j in range(column):
        element += matrix[i][j] * vector[j]
    vector_multi[i][0] = element

for i in vector_multi:
    print(i[0])



Fixed code:
data = list(map(int, list(input().split())))
row = data[0]
column = data[1]
matrix = [[0 for i in range(column)] for j in range(row)]
vector = [[0] for k in range(column)]
vector_multi = [[0] for l in range(row)]

for i in range(row):
    data_row = list(map(int, list(input().split())))
    for j in range(column):
        matrix[i][j] = data_row[j]

for i in range(column):
    vector[i] = int(input())

for i in range(row): 
    element = 0
    for j in range(column):
        element += matrix[i][j] * vector[j]
    vector_multi[i][0] = element

for i in vector_multi:
    print(i[0])
Buggy code:
n,m=map(int, input().split())
A=[list(map(int, input().split()) for _ in range (n)]
b=[int(input()) for _ in range (m)]
for _ in range (n):
 print(sum(a[_][i] * b[i] for i in range(m)))

Fixed code:
n, m = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(n)]
for i in range(m):
    b = int(input())
    for j in range(n):
        A[j][i] *= b
for j in range(n):
    print(sum(A[j]))
Buggy code:
n = list(map(int, input().split()))
ab_sum = 0
a = []
b = []

for i in range(n[0]):
    a.append(list(map(int, input().split())))

for i in range(n[1]):
    b.append(int(input()))

for i in range(n[0]):
    for j in range(n[1]):
        ab_sum += a[i][j] * b[j]
    print(ab_sum)



Fixed code:
n = list(map(int, input().split()))
a = []
b = []

for i in range(n[0]):
    a.append(list(map(int, input().split())))

for i in range(n[1]):
    b.append(int(input()))

for i in range(n[0]):
    ab_sum = 0
    for j in range(n[1]):
        ab_sum += a[i][j] * b[j]
    print(ab_sum)
Buggy code:
n,m = tuple(int(i) for i in input().split())
A = [[int(j) for j in input().split()] for k in range(n)]
b = [int(input()) for p in range(m)]
print(b)
R = [sum([A[p][q] * b[q] for q in range(m)]) for p in range(n)]

for r in R:
    print(str(r))


Fixed code:
n,m = tuple(int(i) for i in input().split())
A = [[int(j) for j in input().split()] for k in range(n)]
b = [int(input()) for p in range(m)]
R = [sum([A[p][q] * b[q] for q in range(m)]) for p in range(n)]

for r in R:
    print(str(r))
Buggy code:
n, m = map(int, input().split())
List1 = [[0 for i in range(m)] for i in range(n)]
for x in range(n):
    List1[x] = list(map(int, input().split()))
List2 = [int(input()) for _ in range(n)]
sum = [0 for i in range(n)]
for x in range(n):
    for y in range(m):
        sum[x] += List1[x][y] * List2[y]
for x in range(n):
    print(sum[x])


Fixed code:
n, m = map(int, input().split())
List1 = [[0 for i in range(m)] for i in range(n)]
for x in range(n):
    List1[x] = list(map(int, input().split()))
List2 = [int(input()) for i in range(m)]
sum = [0 for i in range(n)]
for x in range(n):
    for y in range(m):
        sum[x] += List1[x][y] * List2[y]
for x in range(n):
    print(sum[x])
Buggy code:
l=input().split()
n=int(l[0])
m=int(l[1])

#receive vecter a(n*m)
i=0
A=[]
while i<n:
    a=input().split()
    for p in a:
        A.append(int(p))
    i+=1

#receive vecter b(m*1)
I=0
B=[]
while I<m:
    b=int(input())
    B.append(b)
    I+=1

#Ci=ai1b1+ai2b2+...+aimbm
#C[i]=a[m*(i)+1]*b[1]+a[m*(i)+2]*b[2]+...a[m*(i)+m]*b[m]
q=0
C=[]
while q<n:
    Q=0
    cq=0
    while Q<m:
        cq+=A[m*q+Q]*B[Q]
        Q+=1
    C.append(cq)
    q+=1

print(C)



Fixed code:
l=input().split()
n=int(l[0])
m=int(l[1])

#receive vecter a(n*m)
i=0
A=[]
while i<n:
    a=input().split()
    for p in a:
        A.append(int(p))
    i+=1

#receive vecter b(m*1)
I=0
B=[]
while I<m:
    b=int(input())
    B.append(b)
    I+=1

#Ci=ai1b1+ai2b2+...+aimbm
#C[i]=a[m*(i)+1]*b[1]+a[m*(i)+2]*b[2]+...a[m*(i)+m]*b[m]
q=0
C=[]
while q<n:
    Q=0
    cq=0
    while Q<m:
        cq+=A[m*q+Q]*B[Q]
        Q+=1
    C.append(cq)
    q+=1

for x in C:
    print(x)
Buggy code:

import sys

n, m = input().strip().split(" ")
n = int(n) ;m = int(m)

c = n

a = []
for line in sys.stdin :
    a.append(line)
    c -= 1
    if c == 0 :
        break

c = m

b = []
for line in sys.stdin :
    b.append(line)
    c -= 1
    if c == 0 :
        break

for i in range(0, len(a)) :
    a[i] = a[i].strip().split(" ")
    for j in range(0, len(a[i])) :
        a[i][j] = int(a[i][j])

for i in range(0, len(b)) :
    b[i] = int(b[i].strip())

ans = []
for i in range(0, n) :
    sum = 0
    for j in range(0, m) :
        sum += a[i][j]*b[j]
    ans.append(sum)
print(ans)



Fixed code:

import sys

n, m = input().strip().split(" ")
n = int(n) ;m = int(m)

c = n

a = []
for line in sys.stdin :
    a.append(line)
    c -= 1
    if c == 0 :
        break

c = m

b = []
for line in sys.stdin :
    b.append(line)
    c -= 1
    if c == 0 :
        break

for i in range(0, len(a)) :
    a[i] = a[i].strip().split(" ")
    for j in range(0, len(a[i])) :
        a[i][j] = int(a[i][j])

for i in range(0, len(b)) :
    b[i] = int(b[i].strip())

for i in range(0, n) :
    sum = 0
    for j in range(0, m) :
        sum += a[i][j]*b[j]
    print(sum)
Buggy code:
n, m = map(int, input().split())

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


print(A)
B = []
for j in range(m):
    B.append(int(input()))

print(B)

for k in range(n):
    x = 0
    for l in range(m):
        x += A[k][l] * B[l]
    print(str(x))

Fixed code:
n,m=map(int,input().split())
A=[]
B=[]
for i in range(n):
    A.append(list(map(int,input().split())))
for j in range(m):
    B.append(int(input()))
for l in range(n):
    c=0
    for k in range(m):
        c+=A[l][k]*B[k]
    print(c)
Buggy code:
n, m = map(int, input().split())
a = [[None] * n]
b = [None] * m
for i in range(n):
    a[i] = list(map(int, input().split()))
for i in range(m):
    b[i] = int(input())
for i in range(n):
    c = 0
    for j in range(m):
        c += a[i][j] * b[j]
    print(c)


Fixed code:
n,m=map(int,input().split())
a = [None] * n
for i in range(n):
    a[i] = list(map(int,input().split()))
b = [None] * m
for i in range(m):
    b[i] = int(input())

c = [None] * n
for i in range(n):
    tmp = 0
    for j in range(m):
        tmp += a[i][j] * b[j]
    c[i] = tmp

for val in c:
    print(val)
Buggy code:
n, m = map(int, raw_input().split())
A = []
b = []
C = 0
for i in range(n):
    A += [map(int, raw_input().split())]
for i in range(m):
    b += [input()]
for i in range(n):
    for j in range(m):
        C += A[i][j] * b[j]
    print C

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

A = [[0] * m for i in range(n)]
b = [0] * m

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

for j in range(m):
    b[j] = int(input())

for i in range(n):
    C = 0
    for j in range(m):
        C = C + A[i][j] * b[j]
    print(C)
Buggy code:
n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
b = [int(input()) for _ in range(m)]
for i in a:
    c = 0
    for j, k in i, b:
        c += j * k
    print(c)


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

A = [list(map(int,input().split())) for _ in range(n)]

b = [[int(input())] for _ in range(m)]

c = [0]*n
for i in range(n):
    for j in range(m):
        c[i] += A[i][j]*b[j][0]

for k in range(n):
    print(c[k])