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):
list_arr = []
list_vec = []
list_ans = []
gyou, retsu = list(map(int, input().split()))
for count in range(gyou):
    arr = list(map(int, input().split()))
    list_arr.append(arr)
for count in range(retsu):
    vec = int(input())
    list_vec.append(vec)
for count1 in range(gyou):
    for count2 in range(retsu):
        list_ans.append(list_arr[count1][count2] * list_vec[count2])
    print(sum(list_ans))
    list_ans = []

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

Solution (Python):
n,m=map(int,input().split())
A=[[0 for aa in range(m)]for bb in range(n)]
b=[0 for cc in range(m)]
for zz in range(n):
	unko=list(map(int,input().split()))
	for yy in range(m):
		A[zz][yy]=unko[yy]
for dd in range(m):
	b[dd]=int(input())
for aaa in range (n):
	ole=0
	for bbb in range(m):
		ole=ole+(A[aaa][bbb]*b[bbb])
	print(ole)

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

l = []
for x in range(m) :
  m2 = int(input())
  l.append(m2)

  
for i in range(n):
  R = [x*y for (x,y) in zip(l,T[i])]
  R1 = sum(R)
  print(R1)

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

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

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

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

for _ 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]

    C.append(c)

for c in C:
    print(c)

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 = []
b = []
 
for _ in range(N):
   A.append([int(i) for i in input().split()])
 
for _ in range(M):
   b.append(int(input()))
 
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 = []
b = []

for _ in range(N):
   A.append([int(i) for i in input().split()])

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

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

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

for i in range(n):
    a.append([int(s) for s in 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 = []
b = []

for _ in range(N):
    A.append([int(i) for i in input().split()])
    
for _ in range(M):
    b.append(int(input()))
    
for i in range(N):
    print(sum([A[i][j] * b[j] for j in range(M)]))

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

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

Solution (Python):
if __name__ == "__main__":
    n, m = map(lambda x: int(x), 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(lambda x: int(x), input().split()))

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

    for row in range(n):
        sum = 0
        for col in range(m):
            sum += A[row][col] * B[col]
        print(f"{sum}")

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

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

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

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

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

matrix = [[0 for  _ in range(m)] for _ in range(n)]

for i in range(n):
    List = list(map(int, input().split()))
    for j in range(m):
        matrix[i][j] = Ⅼist[j]
    

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

Answer = []

for item in matrix:
    figure = 0
    for i in range(m):
        figure += item[i]*multiple[i]
    Answer.append(figure)

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

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

Solution (Python):

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

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

b = [0] * 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 = [list(map(int, 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]
    print(c[i])

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

Solution (Python):
sizes = list(map(int, input().split()))
matrix = []
for i in range(sizes[0]):
    matrix.append(list(map(int, input().split())))
vec = []
for i in range(sizes[1]):
    vec.append(int(input()))
for i in range(sizes[0]):
    val = 0
    for j in range(sizes[1]):
        val += vec[j]*matrix[i][j]
    print (val)

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

main()

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

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

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

array_2 = [[] for i in range(n)]
for i in range(n):
    array_2[i] = int(input())

for row in range(m):
    sum = 0
    for cols in range(n):
        sum += array_1[row][cols]*array_2[cols]
    print(sum)

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

Ab = []
for i in range(n):
  Ab.append(0)
  for k in range(m):
    Ab[i] += A[i][k] * b[k]

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

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

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

Solution (Python):
n, m = map(int, input().split())
a = [map(int, input().split()) for _ in range(n)]
b = [int(input()) for _ in range(m)]
s = map(str, [sum([x * y for x, y in zip(aa, b)]) for aa in a])
print('\n'.join(s))

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


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


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




for i in range(n):
	for j in range(m):
		x += array_a[i][j]*array_b[j]
	print(x)
	x=0

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

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

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()
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 = []
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):
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 = [[] 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())
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):
L=input().split( )
n=int(L[0])
m=int(L[1])
 
A=[[0 for i in range(m)] for j in range(n)]
b=[0 for i in range(m)]
x=0
y=0
while x<n:
    StrCollum = input().split( )
    for k in range(m):
        A[x][k] = int(StrCollum[k])
    x+=1
while y<m:
    StrVec = input()
    b[y] = int(StrVec)
    y+=1
c=[0 for i in range(n)]
for z in range(n):
    sum=0
    for u in range(m):
        sum = sum+(A[z][u]*b[u])
        c[z]=sum
for j in range(n):
    print(c[j])

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

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

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

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

line, row = list(map(int, input().split()))

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

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

for l in range(line):
    tmp = 0
    for r in range(row):
        tmp += A[l][r] * b[r]
    c.append(tmp)

for e in c:
    print(e)

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

A=[[0 for i in range(m)] for j in range(n)]
b=[0 for i in range(m)]
x=0
y=0
while x<n:
    StrCollum = input().split( )
    for k in range(m):
        A[x][k] = int(StrCollum[k])
    x+=1
while y<m:
    StrVec = input()
    b[y] = int(StrVec)
    y+=1
c=[0 for i in range(n)]
for z in range(n):
    sum=0
    for u in range(m):
        sum = sum+(A[z][u]*b[u])
        c[z]=sum
for j in range(n):
    print(c[j])

Solution (Python):






import sys
import math
import array


class mymath:
    
    pi = 3.14159265358979323846264338

    
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()


class output:
    
    def list(self, l):
        l = list(l)
        print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()
















def main():
    N, M = [int(x) for x in input().split()]
    A = []
    b = []

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

    for i in range(M):
        b.append(int(input()))
    
    ans = mymath.mul(A,b)

    for i in ans:
        print(i)

if __name__ == '__main__':
    main()

Solution (Python):


from collections import* 
from fractions import gcd
from functools import* 
from itertools import* 
from operator import mul
from bisect import* 
from heapq import* 
from math import factorial,pi
from copy import deepcopy
import sys

sys.setrecursionlimit(10**6)


def main():
    a,b=map(int,input().split())
    g=[list(map(int,input().split()))for i in range(a)]
    h=[int(input())for i in range(b)]
    for i in g:
        print(sum(s*t for s,t in zip(i,h)))

if __name__ == '__main__':
    main()

Solution (Python):

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

matrix_A = []
vector_b = []
vector_c = [0 for i in range(n)]

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

for _ in range(m):
    vector_b.extend([int(input())])


for cnt_n in range(n):
    for cnt_m in range(m):
        vector_c[cnt_n] += matrix_A[cnt_n][cnt_m] * vector_b[cnt_m]
        
    print(vector_c[cnt_n])

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

Solution (Python):
size = input().split()
a_list = [[0 for m in range(int(size[1]))] for n in range(int(size[0]))]
b_list = [[0] for m in range(int(size[1]))]

for n in range(int(size[0])):
    data = input().split()
    for m in range(int(size[1])):
        a_list[n][m] = int(data[m])

for i in range(int(size[1])):
    b_list[i][0] = int(input())

for n in range(int(size[0])):
    c = 0
    for m in range(int(size[1])):
        c += a_list[n][m] * b_list[m][0]
    print(c)

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

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

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=map(int,input().split())
A=[[] 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())
  
for row in range(N):
  tmp=0
  for col in range(M):
    tmp += A[row][col]*B[col]
  print("{:d}".format(tmp))

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

matrix = [None] * N
vector = [0] * M

for i in range(N):
    matrix[i] = [int(c) for c in input().split()]
for i in range(M):
    vector[i] = int(input())

ans = [sum([a * b for a, b in zip(matrix[i], vector)]) for i in range(N)]

for i in ans:
    print(i)

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

for i in range(n):
    a = [int(e) for e in input().split()]
    A.append(a)
    
for j in range(m):
    b = int(input())
    B.append(b)
    
for x in range(n):
    D = 0
    for y in range(m):
        C = A[x][y] * B[y]
        D += C
    print(D)

Solution (Python):

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

for i in range(n):
    ans = 0
    for j in range(m):
        ans += A[i][j]*B[j]
    print("%d"%(ans))

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

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

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

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

Matrix_B = [0 for i in range(m)]


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

result = [[0 for i in range(1)]for i in range(n)]

for i in range(n):
    tmp = 0
    for j in range(m):
        tmp += Matrix_A[i][j] * Matrix_B[j]
    result[i][0] = tmp
for i in range(n):
    print(result[i][0])

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

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

for i in range(n):
    a[i] = [int(x) for x in 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]
    print(c[i][0])

Solution (Python):
if __name__ == '__main__':
	n,m = map(int,input().split())
	a = []
	b = []
	c = []
	for i in range(n):
		a.append([int(s) for s in input().split()])
		c.append(0)
	for i in range(m):
		b.append(int(input()))
	
	for i in range(n):
		ans = 0
		for k in range(m):
			ans = ans + a[i][k]*b[k]
		c[i] = ans

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

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

Solution (Python):

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


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


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


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


for n_tmp in range(n):
    for m_tmp in range(m):
        C[n_tmp][0] += matrixA[n_tmp][m_tmp] * vectorb[m_tmp]


for j in range(n):
    print(C[j][0])

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



for i in range(n):
    print(sum([ma * ve for ma, ve in zip(matrix[i], vector)]))

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


for i in s:
    ans = 0
    for j in range(m):
        ans += i[j] * t[j]
    print(ans)

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

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

Solution (Python):
n,m = map(int,input().split())
a = [map(int,input().split()) for _ in range(n)]
b = [int(input()) for _ in range(m)]
for ai in a:
    print(sum(x*y for x,y in zip(ai, b)))

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

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

for k in range(m):
    x = int(input())
    b.append(x)

for j in A:
    ans = []
    for k in range(m):
        ans.append(j[k]*b[k])
    print(sum(ans))

Solution (Python):
nums = list(map(int, input().split()))
matrix0, matrix1 = [], []
for n in range(nums[0]):
    matrix0.append(list(map(int, input().split())))    
for m in range(nums[1]):
    matrix1.append(int(input()))
for n in range(nums[0]):
    v = 0
    for m in range(nums[1]):
        v += matrix0[n][m] * matrix1[m]
    print(v)

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

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

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

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

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


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

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 r in range(N):
    t = 0
    for c in range(M):
        t += A[r][c]*B[c]
    print("%d"%(t))

Solution (Python):
x, y = map(int,input().split())
A = [[0 for i in range(y)]for i in range(x)]
B = [0 for i in range(y)]

for i in range(x):
    a = list(map(int,input().split()))
    A[i] = a
        
for i in range(y):
    b = int(input())
    B[i] = b
   
ans = [0]*x
for i in range(x):
    for j in range(y):
        ans[i] += A[i][j] * B[j]
for ansi in ans:
    print(ansi)

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())
'''
table = [0 for i in range(N)]

for loop in range(gyou):
    a = list(map(int, input().split()))
    for loop2 in range(retu):
        table[loop][loop2] = a[loop2]
sum = [0,0,0]
for one in range(retu):
    b = int(input())
    for two in range(gyou):
        sum[two] = sum[two] + table[two][one] * b

for three in range(gyou):
    print(sum[three])

'''

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

Solution (Python):



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

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

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

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


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


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


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

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

vector1 = []
vector2 = []


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

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

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

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

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

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

mat = []
for n in range(N):
    buff = input()
    mat.append([int(x) for x in buff.split()])

vec = []
for m in range(M):
    vec.append(int(input()))

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