Problem:
Matrix Vector Multiplication Write a program which reads a $ n \times m$ matrix $A$  and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. A $n \times m$ matrix with $m$ column vectors, each of which consists of $n$ elements, is represented by the following equation. $i$-th element of a $m \times 1$ column vector $b$ is represented by $b_i$ ($i = 1, 2, ..., m$), and the element in $i$-th row and $j$-th column of a matrix $A$ is represented by $a_{ij}$ ($i = 1, 2, ..., n,$  $j = 1, 2, ..., m$). The product of a $n \times m$ matrix $A$ and a $m \times 1$ column vector $b$ is a $n \times 1$ column vector $c$, and $c_i$ is obtained by the following formula: Input In the first line, two integers $n$ and $m$ are given. In the following $n$ lines, $a_{ij}$ are given separated by a single space character. In the next $m$ lines, $b_i$ is given in a line. Output The output consists of $n$ lines. Print $c_i$ in a line. Constraints  $1 \leq n, m \leq 100$  $0 \leq b_i, a_{ij} \leq 1000$  Sample Input 3 4
1 2 0 1
0 3 0 1
4 1 1 0
1
2
3
0 Sample Output 5
6
9

Solution (Python):
n, m=map(int, input().split(" "))
l=1

A = [ [ int(a) for a in input().split() ] for i in range(n) ]
B = [ [ int(b) for b in input().split() ] for i in range(m) ]
C = [ [ 0 for i in range(l) ] for i in range(n) ]

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

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

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

a = [[0 for i in range(m)] for j in range(n)]

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

b=[]
for i in range(m):
    b.append(int(input()))
    
for i in range(n):
    c = 0
    for j in range(m):
        c += a[i][j]*b[j]
    print(c)

Solution (Python):
N,M = map(int, input().split())
A = []
for i in range(N):
    I = list(map(int, input().split()))
    A.append(I)

b = []
for i in range(M):
    bi = []
    I = int(input())
    bi.append(I)
    b.append(bi)

for i in range(N):
    result = 0
    for j in range(M):
        result += A[i][j] * b[j][0]
    print(result)

Solution (Python):
line = int(input().split(" ")[0])
a_vec =[]
b_vec =[]
res = []



for i in range(line):
    
    a_vec.append([int(x) for x in input().split(" ")])


for i in range(len(a_vec[0])):
    b_vec.append(int(input()))

for a_row in a_vec:
    c = 0
    for i, a_col in enumerate(a_row):
        c += a_col * b_vec[i]
    res.append(c)

for r in res:
    print(r)

Solution (Python):
n, m = map(int, input().split())
gyoretu = [[0 for i in range (m)] for j in range(n)]
vector = [] 
vector2 = [0 for i in range(n)] 

for i in range(n):
	
	gyoretu[i] = input().split()
	

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


for i in range(n):
	for j in range(m):
		vector2[i] += int(gyoretu[i][j])*int(vector[j])

for i in range(n): 
	print(vector2[i])

Solution (Python):
A = []
b = []
output = []
n, m = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
b = [int(input()) for j in range(m)]
output = [0 for p in range(n)]

for k in range(n):
    for l in range(m):
        output[k] += A[k][l] * b[l]

for o in range(n):
    print(output[o])

Solution (Python):
n, m = [int(x) for x in input().split()]
matrix = []
for num in range(n):
    matrix.append([int(y) for y in input().split()])
colum = []
for num in range(m):
    colum.append(int(input()))
for i in range(n):
    a = 0
    for j in range(m):
        product = matrix[i][j] * colum[j]
        a += product
    print(a)

Solution (Python):
n,m = (int(i) for i in input().split())
array = [[int(i) for i in input().split()] for i in range(n)]
b = [int(input()) for i in range(m)]
for i in range(n):
    ans = 0
    for i2 in range(m):
        ans += array[i][i2]*b[i2]
    print(ans)

Solution (Python):
m,n = map(int,input().split())
matrix_1 = []
matrix_2 = []
matrix_new = []

for i in range(m):
    x = list(map(int,input().split()))
    matrix_1.append(x)

for j in range(n):
    y = int(input())
    matrix_2.append(y)

c=0
while c<m:
    element = 0
    for j in range(n):
        element += matrix_1[c][j]*matrix_2[j]
    matrix_new.append(element)
    c+=1

for p in range(len(matrix_new)):
    print(matrix_new[p])

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

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

Solution (Python):


import sys
import os


def input_to_list():
    return list(map(int, input().split()))

H, W = input_to_list()
M = []
for i in range(H):
    M.append(input_to_list())

v = []
for i in range(W):
    v.append(int(input()))


for i in range(H):
    all = 0
    for j in range(W):
        all += M[i][j] * v[j]
    print(all)

Solution (Python):
n,m = list(map(int, input().split()))
a = []
b = []
result = []
row_sum = 0

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

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

for row in a:
    for i,num in enumerate(row):
        row_sum += num * b[i]
    print(row_sum)
    row_sum = 0

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

Solution (Python):


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

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

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

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

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

Solution (Python):
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)

Solution (Python):



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()

Solution (Python):



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

nmmatrix = []
mvector = []
result = []


for x in range(n):
    row = input()
    rowSplit = row.split()
    for y in range(len(rowSplit)):
        rowSplit[y] = int(rowSplit[y])
    nmmatrix.append(rowSplit)


for x in range(m):
    mvector.append(int(input()))


for x in range(n):
    value = 0
    for y in range(m):
        value += nmmatrix[x][y]*mvector[y]
    result.append(value)
    

for x in result:
    print(x)

Solution (Python):
def func(amat, bmat, nm):
    for i in range(nm[0]):
        ans = 0
        for j in range(nm[1]):
            ans += amat[i][j] * bmat[j][0]
        print(ans)


if __name__ == '__main__':
    nm = input().split(' ')
    nm = [int(i) for i in nm]
    amat = [[0 for i in range(nm[1])] for j in range(nm[0])]
    bmat = [[0] for i in range(nm[1])]

    for i in range(nm[0]):
        a = input().split(' ')
        for j in range(nm[1]):
            amat[i][j] = int(a[j])

    for i in range(nm[1]):
        b = int(input())
        bmat[i][0] = b

    func(amat, bmat, nm)

Solution (Python):
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)

Solution (Python):
r, c = map(int, input().split())
a, b, ans = [], [], []
for i in range(r):
    a.append([int(x) for x in input().split()])
for i in range(c):
    b.append(int(input()))
for i in range(r):
    tmp = 0
    for j in range(c):
        tmp += a[i][j] * b[j]
    ans.append(tmp)
for x in ans:
    print(x)

Solution (Python):
N ,M= input().split()
a=[]
N=int(N)
M=int(M)
for i in range(N):
    a.append(list(map(int,input().split())))
b=[int(input()) for i in range(M)]
x=[0 for i in range(N)]
for i in range(N):
    for j in range(M):
        x[i]+=a[i][j]*b[j]
print("\n".join(map(str,x)))

Solution (Python):
from operator import mul

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 a in A:
    print(sum(map(mul, a, B)))

Solution (Python):
n,m = map(int, input().split())
AL = []
for i in range(n):
 ALI = list(map(int, input().split()))
 AL.append(ALI)

BL = []
for i in range(m):
 BL.append(int(input()))

for i  in AL:
 Ci = 0
 for (j, ai) in enumerate(i):
  Ci += ai * BL[j]
 print(Ci)

Solution (Python):
n,m=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(input())
for i in range(n):
    ans=0
    for j in range(m): ans+=a[i][j]*b[j]
    print ans

Solution (Python):
a = [[0 for i in range(100)] for j in range(100)]
b = [0 for i in range(100)]
n, m = map(int, input().split())
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)

Solution (Python):
n, m = map(int, input().split())
A = [[0 for i in range(m)] for j in range(n)]

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

b = [0 for i in range(m)]
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)

Solution (Python):
n, m = map(int, raw_input().split())

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

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

print "\n".join(map(str, ans))

Solution (Python):


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

a =[]
b =[]

for i in range(n):
    d = [int(j) for j in input().rstrip().split(" ")]
    a.append(d)

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

for i in range(n):
    ai = list(a[i])
    c = [j*k for j,k in zip(ai,b)]
    print(sum(c))

Solution (Python):
s = input().split(" ")
n = int(s[0])
m = int(s[1])
a = [["" for i in range(m)]for j in range(n)]
b = []
c = []
for i in range(n):
    s = input().split(" ")
    for j in range(m):
        a[i][j] = int(s[j])
for i in range(m):
    b.append(int(input()))
for i in range(n):
    seki = 0
    for j in range(m):
        seki += a[i][j] * b[j]
    c.append(seki)
for i in range(n):
    print(c[i])

Solution (Python):
n,m = map(int,input().split())
a = []
b = []
for i in range(n):
    a.append([int(j) for j in input().split()])
for i in range(m):
    b.append(int(input()))
for i in range(n):
    s = 0
    for j in range(m):
        s += a[i][j] * b[j]
    print(s)

Solution (Python):
A = []
B = []
n, m = [int(i) for i in input().split(' ')]

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

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

Solution (Python):
H, W= map(int, input().split())
A=[]
b=[]
ans=[0 for i in range(H)]
for i in range(H):
    A.append(list(map(int, input().split())))
for j in range(W):
    b.append(int(input()))
for i in range(H):
    for j in range(W):
        ans[i]+=A[i][j]*b[j]
    print(ans[i])

Solution (Python):
rows, cols = [int(x) for x in input().split()]
matrix = []
vector = []
for i in range(rows):
    matrix.append([int(x) for x in input().split()])
for i in range(cols):
    vector.append(int(input()))

for row in matrix:
    result = 0
    for x, y in zip(row, vector):
        result += x*y
    print(result)

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

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

Solution (Python):
def vp(va, vb, i, m):
    return sum([
        va[i][j] * vb[j]
        for j in range(m)
    ])


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

A = []
b = []

for _ in range(n):
    A.append(list(map(int, input().split())))

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

for i in range(n):
    print(vp(A, b, i, m))

Solution (Python):


"""
??´?????????
"""


inp = input().split(" ")
n = int(inp[0])
m = int(inp[1])


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


ArrB = []
for i in range(m):
    ArrB.append(int(input()))


for i in range(n):
    x = 0
    for j in range(m):
        x += ArrA[i][j] * ArrB[j]
    print(str(x))

Solution (Python):
n, m = [int(i) for i in input().split()]
vec = []
for i in range(n):
    vec.append([int(j) for j in input().split()])
c = []
for i in range(m):
    c.append(int(input()))
for i in range(n):
    sum = 0
    for j in range(m):
        sum += vec[i][j]*c[j]
    print(sum)

Solution (Python):
n, m = list(map(int, input().split()))
A = []
V = []
B = []
for i in range(n):
    A.append(list(map(int, input().split())))
for j in range(m):
    V.append([int(input())])
for i in range(n):
    B.append([0])
    for j in range(m):
            B[i][0] += A[i][j] * V[j][0]
for i in range(n):
    print(B[i][0])

Solution (Python):
n, m = list(map(int, input().split(" ")))
A = [[0 for _ in range(m)] for _ in range(n)]
b = [0 for _ in range(m)]

for i in range(n):
    A_line = list(map(int, input().split(" ")))
    for j, a in enumerate(A_line):
        A[i][j] += a
        
for j in range(m):
    b[j] = int(input())
    
for i in range(n):
    ans = 0
    for j in range(m):
        ans += A[i][j] * b[j]
    print (ans)

Solution (Python):
h,w= [int(i) for i in input().split()]
x=[[int(0)for i in range(w)]for j in range(h)]
z=[int(0 ) for i in range(w)]
for i in range(h):
    y=[int(k) for k in input().split()]
    for s in range(w):
        x[i][s]=y[s]
for s in range(w):
    z[s]=int(input())
for i in range(h):
    count=0
    for s in range(w):
        count=count+x[i][s]*z[s]
    print(count)

Solution (Python):
n,m = [int(s) for s in input().split(' ')]
A,b,c = [],[],[]
[A.append([int(s) for s in input().split(' ')]) for i in range(n)]
[b.append(int(input())) for i in range(m)]

for Ai in A:
	ci = []
	for aij,bj in zip(Ai,b):
		ci.append(aij * bj)
	c.append(sum(ci))

[print(ci) for ci in c]

Solution (Python):
n, m = list(map(int, input().split()))

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

for i in range(n):
    print(sum([x * y for (x, y) in zip(A[i], bt)]))

Solution (Python):
n,m = map(int,(input().split()))
a = []
b=[]
c=[]
for i in range(n):
    k = [int(i) for i in input().split()]
    a.append(k)
for i in range(m):
    x = int(input())
    b.append(x)


for j in range(len(a)):
    c.append(0)
    for k in range(len(a[j])):
        c[j] += a[j][k]*b[k]


for j in c:
    print (j)

Solution (Python):
n,m=list(map(int,input().split()))
mA=[list(map(int,input().split())) for i in range(n)]
mB=[int(input())  for j in range(m)]

for ma in mA:
    print(sum([a*b for a, b in zip(ma,mB)]))

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

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

b = [0 for _ in range(m)]
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)

Solution (Python):
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)]

Solution (Python):
A,B = list(map(int, input().split()))

list_A = []
list_B = []

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

for i in range(B):
    b = int(input())
    list_B.append(b)

for i in list_A:
    output = []
    for (y,z) in zip(i,list_B):
        op = y*z
        output.append(op)
    sum_op = sum(output)
    print(sum_op)

Solution (Python):
A = []
b = []

row, col = (int(x) for x in input().split())

for i in range(row):
    A.append([int(x) for x in input().split()])

for i in range(col):
    b.append(int(input()))

for i in range(row):
    print(sum(A[i][j]*b[j] for j in range(col)))

Solution (Python):
n, m = map(int, raw_input().split())
a, b, result = list(), list(), list()
for _ in range(n):
    a.append(map(int, raw_input().split()))
for _ in range(m):
    b.append(int(raw_input()))
for i in range(n):
    temp = 0
    for j in range(m):
        temp += a[i][j] * b[j]
    result.append(temp)
for i in result:
    print(i)

Solution (Python):
i,j=map(int,input().split())
matrix=[list(map(int,input().split())) for _ in range(i)]
vector=[int(input()) for _ in range(j)]
for x in range(i):
    print(sum([v * m for v,m in zip(vector,matrix[x])]))

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

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

Solution (Python):
x=[]
z=[]
A,b=map(int,input().split())
for i in range(0,A):
 a=list(map(int,input().split()))
 x.append(a)
for s in range(0,b):
    q=int(input())
    z.append(q)
    
for i in range(A):
  l=0
  for s in range(b):
    l += x[i][s]*z[s]
  print(l)

Solution (Python):
n, m = map(int, input().split())
A = [[int(e) for e in input().split()] for i in range(n)]
b = []
for i in range(m):
    e = int(input())
    b.append(e)
for i in range(n):
    p = 0
    for j in range(m):
        p += A[i][j] * b[j]
    print(p)

Solution (Python):
A = []
b = []
row = 0
col = 0
row, col = map(int, raw_input().split())
A = [[0 for i in range(col)] for j in range(row)]

for i in range(row):
    r = map(int, raw_input().split())
    for index, j in enumerate(r):
        A[i][index] = j

for i in range(col):
    b.append(int(raw_input()))

for i in A: 
    ret = 0 
    for j,k in zip(i,b):
        ret += j*k
    print ret

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

Solution (Python):


import sys, math, os


PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


n, m = [int(_) for _ in input().split()]
A = [[int(_) for _ in input().split()] for __ in range(n)]
V = [int(input()) for _ in range(m)]

for row in range(n):
    print(sum([A[row][k] * V[k] for k in range(m)]))

Solution (Python):
n, m = map(int, input().split())
a = [[int(num) for num in input().split()] for i in range(n)]
b = [int(input()) for i in range(m)]
for i in range(n):
    c = 0
    for j in range(m):
        c += a[i][j] * b[j]
    print(c)

Solution (Python):
n,m = map(int,input().split())
kakeru = [list(map(int,input().split())) for _ in range(n)]
kakerareru = [int(input()) for _ in range(m)]
for a in range(n):
    kotae = 0
    for b in range(m):
        kotae += kakeru[a][b]*kakerareru[b]
    print(kotae)

Solution (Python):
nm = input().split()
n = int(nm[0])
m = int(nm[1])

matrix = []

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

    matrix.append(row)

column = []
for i in range(m):
    column.append(int(input()))

for i in range(n):
    sum_list = []
    for j in range(m):
        sum_list.append(column[j]*matrix[i][j])
    print(sum(sum_list))

Solution (Python):
box_a = []
box_b = []
tate, yoko = map(int, input().split())
[box_a.append( list(map(int, input().split())) ) for i in range(tate)]
[box_b.append( int(input()) ) for i in range(yoko)]

for i in range(tate):
    stuck = []
    [stuck.append(box_a[i][j]*box_b[j]) for j in range(yoko)]
    
    print(sum(stuck))

Solution (Python):
n,m = [int(i) for i in input().split()]
a = [[int(i) for i in input().split()] for j in range(n)]
b = [0 for i in range(m)]
c = [0 for i in range(n)]
for i in range(m):
    b[i] = int(input())
for i in range(n):
        for j in range(m):
            c[i] += a[i][j] * b[j]
print('\n'.join(map(str,c)))

Solution (Python):
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

Solution (Python):
i, j = map(int, input().split())
a = []
b = []
result = []
for _ in range(i):
	a.append(list(map(int, input().split())))
for _ in range(j):
	b.append(int(input()))
for x in range(i):
	sum = 0
	for y in range(j):
		sum += a[x][y]*b[y]
	result.append(sum)
print (*result, sep="\n")

Solution (Python):
Ia = input().split()
n = int(Ia[0])
m = int(Ia[1])

a = [[0 for midx in range(m)] for nidx in range(n)]
for nidx in range(n):
    A = input().split()
    for midx in range(m):
        a[nidx][midx] = int(A[midx])

b = m * [0]
for bidx in range(m):
    b[bidx] = int(input())

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

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

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

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

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

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

Solution (Python):
n, m = [int(i) for i in input().split()]
A_Matrix = []
B_Matrix = []
output_list = []
tmp = 0
for i in range(n):
        A_Matrix.append([int(j) for j in input().split()])
for i in range(m):
    B_Matrix.append(int(input()))

for i in range(n):
    for j in range(m):
        tmp += A_Matrix[i][j] * B_Matrix[j]
    output_list.append(tmp)
    tmp = 0
for i in range(n):
    print(output_list[i])

Solution (Python):
n, m = list(map(int, input().split()))

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

for v in mat:
    print(sum(a * b for a, b in zip(v, vec)))

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

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

matrix_b = [int(input()) for i in range(m)]

for i in range(n):
    answer = sum([matrix_a[i][j] * matrix_b[j] for j in range(m)])
    print(answer)

Solution (Python):
n,m=map(int,input().split())
a,b=[],[]
for i in range(n):
    a.append(list(map(int,input().split())))
for i in range(m):
    b.append(int(input()))
for i in range(n):
    x=0
    for j in range(m):
        x+=a[i][j]*b[j]
    print(x)

Solution (Python):
n,m=map(int,input().split())
a,b=[],[]
for i in range(n):
    a.append(list(map(int,input().split())))
for i in range(m):
    b.append(int(input()))
for i in range(n):
    x=0
    for j in range(m):
        x+=a[i][j]*b[j]
    print(x)

Solution (Python):
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)))

Solution (Python):
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

Solution (Python):
n, m = map(int, input().split())
a = [[int(n) for n in input().split()] for i in range(n)]
b = []
for i in range(m):
    b.append(int(input()))
c = [0 for i in range(n)]
for i in range(n):
    for j in range(m):
        c[i] += a[i][j] * b[j]
    print(c[i])

Solution (Python):

n, m = [int(x) for x in input().split()]
a = []
b = []
for _ in range(n):
	z = [int(x) for x in input().split()]
	a.append(z)
	
for _ in range(m):
	b.append(int(input()))
	
for i in range(n):
	ans = 0
	for j in range(m):
		ans += a[i][j]*b[j]
	print(ans)

Solution (Python):
n, m = map(int, input().split())
A, B = [list(map(int, input().split())) for r in range(n)], [list(map(int, input().split())) for r in range(m)]
for i in range(n):
    Ci = 0
    for j in range(m):
        Ci += A[i][j] * B[j][0]
    print(Ci)

Solution (Python):
n, m = map(int, input().split())
a = [[v for v in list(map(int, input().split()))] for i in range(n)]
b = [int(input()) for i in range(m)]
c = [sum([a[i][j] * b[j] for j in range(m)]) for i in range(n)]
print('\n'.join(map(str, c)))

Solution (Python):
n, m = map(int, input().split())
a = [[v for v in list(map(int, input().split()))] for i in range(n)]
b = [int(input()) for j in range(m)]
for i in range(n):
    print(sum([a[i][j] * b[j] for j in range(m)]))

Solution (Python):
n, m = map(int, input().split())
a = [[v for v in list(map(int, input().split()))] for i in range(n)]
b = [int(input()) for j in range(m)]
for i in range(n):
    print(sum([a[i][j] * b[j] for j in range(m)]))

Solution (Python):
n, m = map(int,raw_input().split())
matrix = []
for i in range(n):
    matrix.append(map(int,raw_input().split()))
 
vector = []
for i in range(m):
    vector.append(int(raw_input()))
 
for row in range(n):
    sum = 0
    for col in range(m):
        sum += vector[col] * matrix[row][col]
    print sum

Solution (Python):
m1 = []
m2 = []
n, m = [int(s) for s in input().split()]
for i in range(n):
    m1.append([int(s) for s in input().split()])

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

for ma in m1:
    print(sum(map(lambda m, n: m * n, ma, m2)))

Solution (Python):
def main():
    n, m = map(int, input().split())
    
    A = []
    for _ in range(n):
        A.append(list(map(int, input().split())))

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

    for x in range(n):
        ans = 0
        for y in range(m):
            hoge = A[x][y] * b[y]
            ans += hoge
        print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
array_data = map(int, raw_input().split())
n = array_data[0]
m = array_data[1]

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

b = []
for i in range(m):
	partial_b = int(raw_input())
	b.append(partial_b)

ans = []
for i in range(n):
	partial_ans = 0
	for j in range(m):
		partial_ans += A[i][j] * b[j]
	ans.append(partial_ans)

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

Solution (Python):
def main():

    n, m = map(int, (input().split()))
    a = [list(map(int, list(input().split()))) for item in range(n)]
    b = [int(input()) for item in range(m)]

    c = [sum(a_im * b_m for (a_im, b_m) in zip(a_i, b)) for a_i in a]
    for c_i in c:
        print(c_i)


main()

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

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

b = []
for i in range(m):
    b.append(int(input()))

c = []

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

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

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

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

b = [0] * m
for i in range(m):
    b[i] = int(input())

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

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

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

b = [0] * m
for i in range(m):
    b[i] = int(input())

from operator import mul
for i in range(n):
    print(sum(map(mul, A[i], b)))

Solution (Python):
import sys

def main():
    lines = sys.stdin.readlines()

    A = []
    B = []
    C = []
    n = 0
    m = 0
    for i, line in enumerate(lines):
        
        
        line = line.strip('\n')
        elems = line.split(" ")
        if i == 0:
            n = int(elems[0])
            m = int(elems[1])
        elif 0 < i and i < n + 1:
            A.append([int(e) for e in elems])
        elif n < i:
            B.append([int(elems[0])])
    c = []
    for i in range(0, n):
        num = 0
        for index, e in enumerate(A[i]):
            num += e * B[index][0]
        c.append(num)

    for i in range(0, n):
        print c[i]

if __name__ == "__main__":
    main()

Solution (Python):


import fileinput
import math

def main():

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

    A = [[0 for i2 in range(n)] for i1 in range(m)]

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

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

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

        print(sum)

if __name__ == '__main__':
    main()

Solution (Python):
s=input().split()
n=int(s[0])
m=int(s[1])
a=[[0 for j in range(m)]for i in range(n)]
b=[0 for j in range(m)]
for i in range(n):
    t=input().split()
    for j in range(m):
        a[i][j]=int(t[j])
for j in range(m):
    b[j]=int(input())
c=[0 for i in range(n)]
for i in range(n):
    for j in range(m):
        c[i]+=a[i][j]*b[j]
    print("{0}".format(c[i]))

Solution (Python):
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)

Solution (Python):
def main():
    n, m = map(int, input().split())
    matrix = [
        list(map(int, input().split()))
        for _ in range(n)
    ]
    vector = [
        int(input())
        for _ in range(m)
    ]

    for v in matrix:
        res = sum(x * y for x, y in zip(v, vector))
        print(res)

if __name__ == "__main__":
    main()

Solution (Python):
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)))

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

mat_A = []
vec_b = []

for j in range(n):
    mat_A.append(list(map(int, input().split())))
for i in range(m):
    vec_b.append(int(input()))

for j in range(n):
    tmp = 0
    for i in range(m):
        tmp += mat_A[j][i] * vec_b[i]
    print(tmp)

Solution (Python):
n,m=map(int,input().split())
A=[[] for _ in range(n)]
for i in range(n):
 A[i] = [_ for _ in map(int,input().split())]
b=[]
for i in range(m):
 b.append(int(input()))
for i in range(n):
 c=0
 for j in range(m):
  c+=A[i][j]*b[j]
 print(c)

Solution (Python):
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 range(n):
 print(sum([A[i][j]*b[j] for j in range(m)]))