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):
def calc_matrix_product(M, x, row, col):

    

    for r in range(row):
        s = 0
        for c in range(col):
            s += M[r][c] * x[c]
        print(str(s))
        
        
        
        
        
        


if __name__ == "__main__":
    param = input().split(" ")
    row = int(param[0])
    col = int(param[1])

    
    M = list()
    r = row

    while(r > 0):

        param = input().split(" ")
        M.append([ int(a) for a in param ])

        r = r - 1

    
    c = col
    x = list()

    while( c > 0 ):

        param = input()

        x.append(int(param))

        c = c - 1

    calc_matrix_product(M, x, row, col)

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

A = [[0 for i in range(m)]for j in range(n)]
B = [0 for i in range(m)]
Anser = [0 for i in range(n)]

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):
    for j in range(m):
        Anser[i] += A[i][j]*B[j]
    print(Anser[i])

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

for i in range(n):
    r = 0
    for k,l in zip(mat[i],vec):
        r += k*l
    print(r)

Solution (Python):
n,m=map(int ,input().split())
a=[[None]*m for i in range(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())
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=[]
b=[]
for i in range(n):
    an=list(map(int,input().split()))
    a.append(an)

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

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

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

Solution (Python):
i, j = map(int,input().split())
a = []
b = []
result = 0
for _ in range(i):
    a.append([row for row in map(int, input().split())])
for _ in range(j):
    b.append(int(input()))
for row in range(i):
    for col in range(j):
        result += a[row][col] * b[col]
    print(result)
    result = 0

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


list1 = [[0]*m for i in range(n)]
list2 = [0]*m

for i in range(n):
    list = input().split()
    for j in range(m):
        list1[i][j]=int(list[j])
for j in range(m):
    list2[j] = int(input())

sum = [0]*n
for i in range(n):
    for j in range(m):
        sum[i] += list1[i][j] * list2[j]
for i in range(n):
    print(sum[i])

Solution (Python):
matrixA = []
matrixB = []
resultC = []
n, m = map(int, input().split())
for i in range (n):
    matrixA.append(list(map(int, input().split())))
for i in range (m):
    matrixB.append(int(input()))
for i in range (n):
    num = 0
    for j in range (m):
        num += matrixA[i][j]*matrixB[j]
    resultC.append(num)
for i in range (n):
    print(resultC[i])

Solution (Python):
n, m = list(map(int, input().split(" ")))
a_nm = [list(map(int, input().split(" "))) for i in range(n)]
b_nm = [int(input()) for k in range(m)]

for ab in a_nm:
    mul = 0
    for j in range(m):
        
        mul = mul + ab[j] * b_nm[j]
    print(mul)

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

A=[];B=[]
for i in range(n):
    A.append(input())
    
for i in range(m):
    B.append(int(input()))

for i in range(len(A)):
    Arc=[int(k) for k in A[i].split()]
    x=0
    for k in range(len(Arc)):
       x += Arc[k]*B[k]
    print(x)

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

for i in range(n):
    cvec = 0
    for j in range(m):
        cvec = cvec + (avec[i][j] * bvec[j])
    print(cvec)

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):
    ci = 0
    for j in range(m):
        ci += A[i][j]*b[j]
    print(ci)

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

Solution (Python):
listInf = input().split()
listInf[0] = int(listInf[0])
listInf[1] = int(listInf[1])
s = []
ans = []

a = [[0]*listInf[1] for _ in range(listInf[0])]
b = [0 for _ in range(listInf[1])]

for column in range(listInf[0]):
    oneOfA = input().split()
    for row in range(listInf[1]):
        a[column][row] = int(oneOfA[row])

for c in range(listInf[1]):
    b[c] = int(input())

for x in range(listInf[0]):
    for y in range(listInf[1]):
        s.append(a[x][y]*b[y])
    print(sum(s))
    s.clear()

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

a = []

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

b = []

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

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

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 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):
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 for _ in range(n)]
for i in range(n):
    for j in range(m):
        C[i] += A[i][j] * B[j]
for c in C:
    print(c)

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

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

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

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

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

Solution (Python):
n,m = map(int, input().split())
a = list()
for s in range(n):
    a.append(list(map(int, input().split())))
    
b = list()
for g in range(m):
    b.append(int(input()))

for ss in range(n):
    sum = 0
    for gg in range(m):
        sum += a[ss][gg] * b[gg]
    print(sum)

Solution (Python):
from collections import defaultdict
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    h,w=map(int,input().split())
    aa=[list(map(int,input().split())) for _ in range(h)]
    bb=[int(input()) for _ in range(w)]
    for ak in aa:
        ans=0
        for a,b in zip(ak,bb):
            ans+=a*b
        print(ans)

main()

Solution (Python):
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

N,M = map(int,input().split())

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

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

B = [[0]*1 for i in range(M)]

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


for row in range(N):
    tmp = 0
    for col in range(M):
        tmp += A[row][col]*B[col]
    print("%d"%(tmp))

Solution (Python):
n,m = [ int(s) for s in input().split() ]
  
v1 = [ [0] * m for i in range(n) ]
v2 = [0] * m

for i in range(n):
    v1[i] = [ int(s) for s in input().split() ]

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

for i in range(n):
    total = 0
    for j in range(m):
        total += v1[i][j] * v2[j]
    print(total)

Solution (Python):
n, m = map(int, input().split())
matrixA = [[0] * (m) for i in range(n)]
matrixB = [[0] for i in range(m)]
matrix = [[0] for i in range(n)]

for i in range(0, n):
    listnum = input().split()
    for j in range (0, m):
        matrixA[i][j] = listnum[j]

for i in range(0,m):
    matrixB[i][0] = input()

for i in range(0,n):
    s = 0
    for j in range(0,m):
        s = s+int(matrixA[i][j])*int(matrixB[j][0])
        matrix[i][0] = str(s)

for i in range(0, n):
    print(" ".join(matrix[i]))

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

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

Solution (Python):
lst_1 = list(map(int, input().split()))
n, m = lst_1[0], lst_1[1]
lst = []
vec = []
for i in range(n):
    lst_2 = list(map(int, input().split()))
    lst.append(lst_2)

for i in range(m):
    num = int(input())
    vec.append(num)

for i in range(n):
    c = []
    for j in range(m):
        cj = lst[i][j] * vec[j]
        c.append(cj)
    print(sum(c))

Solution (Python):
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()))
    
C = [0 for _ in range(n)]

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

for c in C:
    print(c)

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

A = []
for _ in range(n):
    A.append([int(i) for i in input().split()])
b = [int(input()) for _ in range(m)]
    
ans = []
for a in A:
    ans.append(sum([x * y for x, y in zip(a, b)]))

for a in ans:
    print(a)

Solution (Python):
n,m=list(map(int,input().split()))
A=[list(map(int,input().split())) for i 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]

print(*c, sep='\n')

Solution (Python):
n,m = map(int, input().split())
amat = [[0 for i in range(m)] for j in range(n)]
bmat = [[0 for k in range(1)] for l in range(m)]
cmat = [[0 for x in range(1)] for y in range(n)]
for i in range(n):
 amat[i] = list(map(int, input().split()))
for j in range(m):
 bmat[j][0] += int(input())
for k in range(n):
 for l in range(m):
  cmat[k][0] += amat[k][l]*bmat[l][0]
 print(cmat[k][0])

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):
    c = 0
    for j in range(m):
        c += a[i][j] * b[j]
    print(c)

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

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

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

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

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

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

c = [None] * n
for i in range(n):
    for j in range(m):
        if c[i] is None:
            c[i] = A[i][j] * b[j]
        else:
            c[i] += A[i][j] * b[j]

for item in c:
    print(item)

Solution (Python):

n,m = map(int,input().split())
a = list()
b = list()
c = 0
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):
    for j in range(m):
        c += a[i][j]*b[j]
    print(c)
    c = 0

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

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

for i in a:
    x = 0
    for k in range(m):
        x += i[k]*b[k]
    else:
        print(x)

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

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

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

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

Solution (Python):
N,M = map(int,input().split())

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

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

B = [[0]*1 for i in range(M)]

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


for row in range(N):
    tmp = 0
    for col in range(M):
        tmp += A[row][col]*B[col]
    print("%d"%(tmp))

Solution (Python):
n, m = map(int, input().split(" "))
A = []
b = []
ci = 0

for i in range(n):
    a = list(map(int, input().split(" ")))
    A.append(a)
for i in range(m):
    bi = int(input())
    b.append(bi)

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

Solution (Python):
u,v=list(map(int,input().split()))
a=[[0]*v for j in range(u)]

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

b=[0 for i in range(v)]

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

for i in range(u):
    c=0
    for j in range(v):
        c+=a[i][j]*b[j]
    print(c)

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

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


for i in range(n):
    sum = 0
    for j in range(m):
        sum += matrix[i][j] * colum[j]
        
    print(sum)

Solution (Python):
n, m = map(int, input().split())
arr_a = []
vec_b = []
for x in range(0, n):
    arr_a.append(list(map(int, input().split())))
for y in range(0, m):
    vec_b.append(int(input()))

for ni in range(0, n):
    s = 0
    for mi in range(0, m):
        s += (arr_a[ni][mi] * vec_b[mi])
    print(s)

Solution (Python):
N, M = map(int, input().split())

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

for i in range(M):
    bi = int(input())
    for j in range(N):
        A[j][i] *= bi

for i in range(N):
    print(sum(A[i]))

Solution (Python):
def get_matrix_size(x):
    row = len(x)
    col = len(x[0])
    return row, col

def get_matrix(x):
    row, col = get_matrix_size(x)
    for i in range(row):
        line = list(map(int, input().split()))
        if len(line) != col:
            break
        x[i] = line

def get_matrix_product(a, b):
    a_row, a_col = get_matrix_size(a)
    b_row, b_col = get_matrix_size(b)
    if a_col != b_row:
        return
    c_row = a_row
    c_col = b_col
    c = [[0 for j in range(c_col)] for i in range(c_row)]
    for i in range(c_row):
        for j in range(c_col):
            for k in range(a_col):
                c[i][j] += a[i][k] * b[k][j]    
    return c

n, m = map(int, input().split())
a = [[0 for j in range(m)] for i in range(n)]
b = [[0 for j in range(1)] for i in range(m)]
get_matrix(a)
get_matrix(b)
c = get_matrix_product(a, b)
for i in range(len(c)):
    print(c[i][0])

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

matrix = list()
vector = list()
result = list()

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

for i in range(n):
    vector.append(int(input()))
    
for j in range(m):
    suma = 0
    for i in range(n):
        suma += matrix[j][i] * vector[i]
    result.append(suma)

for s in result:
    print(s)

Solution (Python):
A, b, c = [], [], []
n, m = map(int, input().split())
for i in range(n):
    A.append([int(x) for x in input().split()])
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]
for i in range(n):
    print(c[i])

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

a = [[] for i in range(n)]
for i in range(n):
	a[i] = list(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):
r,c=map(int, input().split())

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

for j in range(c):
    b.append(int(input()))
    
    
for j in range(r):
    q=0
    for i in range(c):
        q=q+a[j][i]*b[i]
    print("%d"%q)

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(k*l for k,l in zip(A[i],B)))

Solution (Python):
rows,cols=map(int,input().split(" "))
a=[[0 for i in range(cols)] for j in range(rows)]
b=[0 for col in range(cols)]
c=[0 for row in range(rows)]

for row in range(rows):
    a_val=list(map(int,input().split(" ")))
    for col in range(cols):
        a[row][col]=a_val[col]

for col in range(cols):
    b_val=int(input())
    b[col]=b_val

for row in range(rows):
    for col in range(cols):
        c[row]+=a[row][col]*b[col]

for row in range(rows):
    print(c[row])

Solution (Python):
rows, columns = map(int, (input().split()))

matrixA = list()
matrixB = list()


for _ in range(rows):
    row = list(map(int, input().split()))
    matrixA.append(row)


for _ in range(columns):
    num = int(input())
    matrixB.append(num)


result = list()
for ir in range(rows):
    sum = 0
    for ic in range(columns):
        sum += matrixA[ir][ic] * matrixB[ic]
    result.append(sum)
    

for num in result:
    print(num)

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

for i in range(n):
    printsum = 0
    for j in range(m):
        printsum += array1[i][j] * array2[j]
    print(printsum)

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

Solution (Python):
x,y=map(int,input().split())
A=list(list(map(int,input().split())) for i in range(x))
B=list(int(input()) for i in range(y))
ans=[]
for i in range(x):
    count=0
    for j in range(y):
        count +=A[i][j]*B[j]
    ans.append(count)
for i in range(len(ans)):print(ans[i])

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

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

c_mtx = []
for a in a_mtx:
    accu = 0
    for b, c in zip(a, b_mtx):
        accu += b*c
    c_mtx.append(accu)

for cc in c_mtx:
    print(cc)

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 x in a:
    print(sum([v * w for v, w in zip(x, b)]))

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

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

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

   
for i in A:
    answer_sum = 0 
    for j,k in enumerate(B):
        a = i[j]*k
        answer_sum  += a
    print(answer_sum)

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())])
Ab=[[0]for i in range(n)]
for i in range(n):
    for j in range(m):
        Ab[i][0]+=A[i][j]*b[j][0]
    print(Ab[i][0])

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

B = [i 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 = (int(x) for x in input().split())
A = [[0 for i in range (m)] for j in range (n)]
B = [0]*m

for _ in range(n):
    a = [int(x) for x in input().split()]
    for i,j in enumerate(a):
        A[_][i] = j

for _ in range(0, m):
    B[_] = int(input())

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

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)]
ans = []

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

print(*ans, sep='\n')

Solution (Python):
n, m = map(int, input().split())
A = list()
b = list()
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):
    _ = 0
    for j in range(m):
        _ = _ + (A[i][j] * b[j])
    print(_)

Solution (Python):
n, m = [int(x) for x in input().split()]

matrix = []
for i in range(n):
    l = [int(x) for x in input().split()]
    matrix.append(l)

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


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

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

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

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




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

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

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

def seki(x, y):
    return x*y

for i in range(n):
    print(sum(list(map(seki, a[i], b))))

Solution (Python):


n, m = map(int, input().split())
a = list()
b = list()
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):
    S = 0
    for j in range(m):
        S += a[i][j] * b[j]
    print(S)

Solution (Python):
def test():

	inputs = list(map(int,input().split()))

	n = inputs[0]
	m = inputs[1]

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

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

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

		print(f"{Answer[i]}")


if __name__ == "__main__":
	test()

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

Solution (Python):
r,c = map(int,input().split())

a = [[0 for i in range(c)] for i in range(r)]

for i in range(r):
    k = 0
    for j in map(int, input().split()):
        a[i][k] = j
        k+=1

b = [0] * c

for i in range(c):
    b[i] = int(input())
    
for i in range(r):
    t = 0
    for j in range(c):
        t+=(a[i][j] * b[j])
    print(t)

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)]
[print(sum([j*k for j,k in zip(a[i],b)]))for i in range(n)]

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

for Ai in A:
    ans = 0
    for a, b in zip(Ai, B):
        ans += a * b
    print(ans)

Solution (Python):
n,m = map(int,input().split())
A =[[0 for i in range(m)] for i in range(n)]
B =[0 for i in range(m)]
for i in range(n):
    A[i] = list(map(int,input().split()))
for i in range(m):
    B[i] = int(input())
c = 0
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 i in range(n)]
b=[int(input()) for i in range(m)]
for i in range(n):
    sumab=0
    for j in range(m):
        sumab=sumab+a[i][j]*b[j]
    print(sumab)

Solution (Python):
f=lambda:list(map(int,input().split()))
n,m=f()
M=[f()for _ in [0]*n]
V=[f()[0]for _ in [0]*m]
for v in M:print(sum(i*j for i,j in zip(v,V)))

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

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

Solution (Python):

"""
Created on Sat Aug 10 03:11:43 2019

@author: Atsushi
"""

a,b = map(int,input().split())
mat = []

for i in range(a):
    mat.append(list(map(int,input().split())))
    
vec = []
for i in range(b):
    vec.append(int(input()))
    
for i in range(a):
    ans = 0
    
    for j in range(b):
       ans += mat[i][j] * vec[j]
    print(ans)

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

'''
考えたプログラム

二次元配列を組む
list_m =[[0 for p in range(m)] for q in range(n)]

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

1次元配列を組む
list_v = [0 for r in range(m)]

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

sum0 = 0
for p in range(n):
    for q in range(m):
        sum0 += list_m[p][q] * list_v[q]
    print(sum0)
    sum0 = 0
'''

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


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

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

for i in range(n):
    res = 0
    for j in range(m):
        res += (mat[i][j] * vec[j])
    print(res)

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

A=[list(map(int,input().split())) for y in range(n)]
B=[int(input()) for y 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())
a = [list(map(int, input().split())) for _ in range(n)]
b = [int(input()) for _ in range(m)]
ans = [0 for _ in range(n)]
for i in range(n):
    for j in range(m):
        ans[i] += a[i][j]*b[j]
print("\n".join(map(str, ans)))

Solution (Python):
N,M = map(int,input().split())
A = [[] for i in range(N)]
for i in range(N):
    A[i] = list(map(int,input().split()))
B = [[0]*1 for i in range(M)] 
for i in range(M):
    B[i] = int(input()) 
for row in range(N):
    tmp = 0
    for col in range(M):
        tmp += A[row][col]*B[col]
    print("%d"%(tmp))

Solution (Python):
n, m = map(int, input().split())
a = list()
for i in range(n):
    a.append(list(map(int, input().split())))
b = list()
for i 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=[list(map(int,input().split())) for _ in range(n)]
b=[int(input()) for _ in range(m)]
[print(sum([j*k for j,k in zip(a[i],b)])) for i in range(n)]

Solution (Python):
import sys,os,re
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate
sys.setrecursionlimit(10**6)

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)]
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 = map(int, input().split())


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

c = [0] * n

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

for c_ in c:
    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):
  x = input().split()
  for j in range(m):
    A[i][j] = int(x[j])
 
b = [0 for i in range(m)]
for i in range(m):
  b[i] = 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]
 
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 i 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 = [], []
for row in range(n):
    a.append(list(map(int, input().split())))
for row 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())
l = []
for i in range(n):
    l1 = list(map(int,input().split()))
    l.append(l1)
l2 = []
for i in range(m):
    l2.append(int(input()))

for i in range(n):
    tmpc = 0
    for j in range(m):
        tmpc+=l[i][j]*l2[j]
    print(tmpc)

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

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