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 read_a(n, m):
    A = []
    for _ in range(0, n):
        A.append([int(x) for x in input().split()])

    return A

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

    return B

def multiply(A, B):
    C = []
    for a in A:
        C.append(sum(map(lambda x, y:x*y, a, B)))

    return C

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

    A = read_a(n, m)
    B = read_b(m)
    C = multiply(A, B)

    print("\n".join([str(x) for x in C]))

if __name__ == '__main__':
    main()

Solution (Python):
def main():

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

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

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

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



if __name__ == '__main__':
    main()

Solution (Python):
import sys


def main():
    n, m = map(int, sys.stdin.readline().split())
    matrix = []
    for i in range(n):
        matrix.append(list(map(int, sys.stdin.readline().split())))
    vector = []
    for i in range(m):
        vector.append(int(sys.stdin.readline()))
    product = [0] * n
    for i in range(n):
        for j in range(m):
            product[i] += matrix[i][j] * vector[j]
    for i in product:
        print(i)
    return


if __name__ == '__main__':
    main()

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

Solution (Python):
A_element = []
B_element = []
C_element = []
ele_num = [int(x) for x in input().split()]
for i in range(ele_num[0]):
    C_element.append(0)
for i in range(ele_num[0]):
    element = [int(x) for x in input().split()]
    A_element.append(element)

for i in range(ele_num[1]):
    element = int(input())
    B_element.append(element)

for i in range(ele_num[0]):
    for j in range(ele_num[1]):
        C_element[i] =C_element[i] + (A_element[i][j] * B_element[j])

for out in C_element:
    print(out)

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

ans = [sum([a[j][i] * b[i] for i in range(m)]) for j in range(n)]
print(*ans, sep='\n')

Solution (Python):
import sys


def read_data():
    n, m = [int(i) for i in sys.stdin.readline().strip().split(' ')]
    matrix = []
    for _ in range(n):
        matrix.append([int(num) for num in sys.stdin.readline().strip().split(' ')])

    vector = []
    for _ in range(m):
        vector.append(int(sys.stdin.readline().strip()))

    return matrix, vector


def multiple(matrix, vector):
    n = len(matrix)
    m = len(vector)
    ans = []

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

        ans.append(sum)

    return ans


def main():
    matrix, vector = read_data()
    ans = multiple(matrix, vector)
    for i in ans:
        print(i)
        
if __name__ == '__main__':
    main()

Solution (Python):
a = input().split()
a[0] = int(a[0])
a[1] = int(a[1])
x = []
y = []
z = []

for i in range(a[0]):
    b = input().split()
    for j in range(a[1]):
        b[j] = int(b[j])
    x.append(b)
    z.append(0)
for i in range(a[1]):
    c = int(input())
    y.append(c)  
for i in range(a[0]):
    for j in range(a[1]):
        z[i] += x[i][j]*y[j]
for i in z:
    print(i)

Solution (Python):

n, m = map(int, input().split())
matrixA = []
vectorB = []

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

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


for i in range(n):
    num = 0
    for j in range(m):
        num += matrixA[i][j] * vectorB[j]
    print(num)

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 = 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()))
c = []
for i in range(n):
    c.append(sum([a[i][j] * b[j] for j in range(m)]))
for i in c:
    print(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, ai in enumerate(a):
    cnt = 0
    for j, bj in enumerate(b):
       cnt += ai[j] * bj
    print(cnt)

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, ai in enumerate(a):
    cnt = 0
    for j, bj in enumerate(b):
       cnt += ai[j] * bj
    print(cnt)

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] * m
for i in range(m):
    b[i] = int(input())

for ai in a:
    cnt = 0
    for j, bj in enumerate(b):
        cnt += ai[j] * bj
    print(cnt)

Solution (Python):
n, m = map(int, input().split())
A = [[0 for _ in range(m)] for _ in range(n)]
B = [0 for _ in range(m)]
for y in range(n):
    column = list(map(int, input().split()))
    for x in range(m):
        A[y][x] = column[x]

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

for a in A:
    c = 0
    for i in range(m):
        c += a[i]*B[i]
    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_str=input().split()
n_m=list(map(lambda i : int(i),n_m_str))
n,m=n_m[0],n_m[1]
a=[input() for i in range(n)]
A=[]
for i in a:
    A.append(i.split())
b=[input() for i in range(m)]
Ab=[]
for i in range(n):
    Ab.append(0)
for i in range(n):
    for j in range(m):
        Ab[i]+=int(A[i][j])*int(b[j])
for i in Ab:
    print(i)

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):
readline = open(0).readline
N, M = map(int, readline().split())
A = [list(map(int, readline().split())) for i in range(N)]
B = [int(readline()) for i in range(M)]
print(*map((lambda Ai: sum(a*b for a, b in zip(Ai, B))), A), sep='\n')

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):
from sys import stdin

n, m = [int(x) for x in stdin.readline().rstrip().split()]
a = [[int(x) for x in stdin.readline().rstrip().split()] for _ in range(n)]
b = [[int(stdin.readline().rstrip())] for _ in range(m)]
c = [[0] for _ 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])

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

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

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

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 = 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):
    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 a:
    c = 0
    for j, k in zip(i, b):
        c += j * k
    print(c)

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

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

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

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

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

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

Solution (Python):
n, m = map(int, input().split())
A = [map(int, input().split()) for _ in [None] * n]
b = [int(input()) for _ in [None] * m]
for a in A:
    print(sum(i * j for i, j in zip(a, b)))

Solution (Python):
n, m = map(int, input().split())
A = [map(int, input().split()) for _ in [None] * n]
b = [int(input()) for _ in [None] * m]
for a in A:
    print(sum(i * j for i, j in zip(a, b)))

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

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











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

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


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












c = []
for row in range(len(A)):
    tmp = 0
    for col in range(len(A[row])):
        tmp += A[row][col] * b[col]
    c.append(tmp)
for i in range(len(c)):
    print(c[i])

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


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












for row in range(len(A)):
    tmp = 0
    for col in range(len(A[row])):
        tmp += A[row][col] * b[col]
    print(tmp)

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

Solution (Python):

rowNum, columnNum = map(int, input().split())
inMat = [[0] * columnNum for i in range(rowNum)]
inColumnVec = [[0] for i in range(columnNum)]
for row in range(rowNum):
    inMat[row] = [int(i) for i in input().split()]
for column in range(columnNum):
    inColumnVec[column] = int(input())

timesAns = [[0] for i in range(rowNum)]


for row in range(rowNum):
    timesAns[row] = 0
    for column in range(columnNum):
        timesAns[row] = timesAns[row] + inMat[row][column] * inColumnVec[column]

for row in range(rowNum):
    print(timesAns[row])

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

Solution (Python):
n,m = map(int,input().split())
tbl=[[] for i in range(n)]
for i in range(n):
    tbl[i] = list(map(int,input().split()))
tbl2=[[]*1 for i in range(m)]
for i in range(m):
    tbl2[i] = int(input())
for k in range(n):
    x=0
    for l in range(m):
        x +=tbl[k][l]*tbl2[l]
    print("%d"%(x))

Solution (Python):
n,m = map(int,input().split())
tbl=[[] for i in range(n)]
for i in range(n):
    tbl[i] = list(map(int,input().split()))
tbl2=[[]*1 for i in range(m)]
for i in range(m):
    tbl2[i] = int(input())
for k in range(n):
    x=0
    for l in range(m):
        x +=tbl[k][l]*tbl2[l]
    print("%d"%(x))

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

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

for a in A:
    multi_list = [x * y for (x, y) in zip(a, b)]  
    arg = 0
    for k in multi_list:
        arg += k
    print(arg)

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

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

Solution (Python):
m,n=map(int,input().split())
a=[]
b=[]
for _ in range(m):
    a.append(map(int, input().split()))
for _ in range(n):
    b.append(int(input()))
for ai in a:
    sum = 0
    for index, mi in enumerate(ai):
        sum += mi*b[index]
    print(sum)

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

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


i = 0
while i < n:
  table[i] = list(int(x) for x in input().split())
  i += 1


i = 0
while i < m:
  vector[i] = int(input())
  i += 1


for i in table:
  sum = 0
  for idx,j in enumerate(i):
    sum += j * vector[idx]
  print (sum)

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

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

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

Solution (Python):
x,y = map(int,input().split(" "))

line_1 = [[0 for _ in range(y)] for _ in range(x)]
for i in range(x):
	line_1[i] = list(map(int,input().split(" ")))

line_2 = [int(input()) for _ in range(y) ]

[print(sum([line_1[k][m] * line_2[m] for m in range(y)])) for k in range(x)]

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

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

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

Solution (Python):
def my_dot(lhs, rhs):
    return [sum(a[i][j] * b[j][0] for j in range(len(rhs))) for i in range(len(lhs))]


if __name__ == '__main__':
    from sys import stdin

    n, m = (int(n) for n in stdin.readline().rstrip().split())

    a = []
    for cnt in range(n):
        a.append([int(n) for n in stdin.readline().rstrip().split()])

    b = []
    for cnt in range(m):
        b.append([int(n) for n in stdin.readline().rstrip().split()])

    c = my_dot(a, b)

    for cn in c:
        print(int(cn))

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

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

for i in c:
    print(i)

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

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

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

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

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

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

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

m2 = m

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

b=[]
while m2 > 0:
  b_data = int(input())
  b.append(b_data)
  m2 = m2-1

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

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

a = [0]*N
for i in range(N):
  a[i] = 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 aj, bj in zip(a[i], b):
    c[i] += aj * bj
    
for ci in c:
  print(ci)

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


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

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

Solution (Python):
def az18():
    n,m = map(int,raw_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] = map(int,raw_input().split())
    for i in range(m):
        b[i] = input()
    for i in range(n):
        t = map(lambda (x,y): x*y, zip(a[i],b))
        print sum(t)
        
    
    
az18()

Solution (Python):
n, m = map(int, raw_input().split());
i = 0
ar = [0] * n
vc = [0] * m
while i < n:
	ar[i] = map(int, raw_input().split());
	i += 1
i = 0
while i < m:
	vc[i] = input();
	i += 1
for el in ar:
	ans = 0
	for el2, el3 in zip(vc, el):
		ans += el2 * el3
	print ans

Solution (Python):
[r,c] = raw_input().split()
r = int(r)
c = int(c)
M = []
V = []
for y in range(0,r):
    s = raw_input().split()
    k = []
    for x in range(0,c):
        v = int(s[x])
        k.append(v)
    M.append(k)
    
for y in range(0,c):
    s = int(raw_input())
    V.append(s)
    

for y in range(0,r):
    ss = 0
    for x in range(0,c):
        ss = ss + M[y][x] * V[x]
    print ss

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

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

for obj in matrix:
    print(sum(obj[i] * b[i] for i in range(m)))

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

Solution (Python):
nm = list(map(lambda x:int(x),input().split(" ")))

a = list()
b = list()

count = nm[0]
while count > 0:
    a += list(map(lambda x:int(x), input().split(" ")))
    count -= 1

count = nm[1]
while count > 0:
    b += {int(input())}
    count -= 1

for m in range(nm[0]):
    c = 0
    for k in range(nm[1]):
        c += a[k+m*nm[1]]*b[k]
    print(c)

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

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

b = []
for j in xrange(0,m):
	temp = int(raw_input())
	b.append(temp)

result = []
for x in xrange(0,n):
	temp = 0
	for y in xrange(0,m):
		temp = temp + A[x][y] * b[y]
	result.append(temp)

for k in xrange(0,n):
	print result[k]

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

Solution (Python):
n,m = map(int,raw_input().split())
gyoretu = []
bekutoru = []
for i in range(n):
    gyoretu.append(map(int,raw_input().split()))
for i in range(m):
    bekutoru.append(input())

for a in gyoretu:
    i = 0
    for b in range(len(bekutoru)):
        i = i + (a[b] * bekutoru[b])
    print i

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

for i in range(n):
    print(sum([array[i][j] * vec[j] for j in range(m)]))

Solution (Python):
def f():return map(int,raw_input().split())
n,m = f()
A = [f() for _ in [0]*n]
B = [input() for _ in [0]*m]
for i in range(n):
  print sum([A[i][j]*B[j] for j in range(m)])

Solution (Python):
def f():return map(int,raw_input().split())
n,m = f()
A = [f() for _ in [0]*n]
B = [int(raw_input()) for _ in [0]*m]
for i in range(n):
  print sum([A[i][j]*B[j] for j in range(m)])

Solution (Python):

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

A = []
for i in range(n):
    A.append([int(x) for x in raw_input().split(" ")])

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

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

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

a = [0] * n 
for i in range(n):
    a[i] = 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 aj, bj in zip(a[i], b):
        c[i] += aj * bj
    
for ci in c:
    print(ci)

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

matrix = []
vector = []
product = [0 for d in range(n)]

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

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

for nc in range(n):
    for mc in range(m):
        product[nc] += matrix[nc][mc] * vector[mc]

[print(product[nc]) for nc in range(n)]

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

matrix = []
vector = []
product = [0 for d in range(n)]

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

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

for nc in range(n):
    for mc in range(m):
        product[nc] += matrix[nc][mc] * vector[mc]

[print(product[nc]) for nc in range(n)]

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

matrix = []
vector = []
product = [0 for d in range(n)]

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

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

for nc in range(n):
    for mc in range(m):
        product[nc] += matrix[nc][mc] * vector[mc]

[print(product[nc]) for nc in range(n)]

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

matrix = []
vector = []
product = [0 for d in range(n)]

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

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

for nc in range(n):
    for mc in range(m):
        product[nc] += matrix[nc][mc] * vector[mc]

[print(product[nc]) for nc in range(n)]

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

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

Solution (Python):
import sys
(n, m) = [int(i) for i in sys.stdin.readline().split()]
matrix = []
for i in range(0, n):
    a_i = [int(j) for j in sys.stdin.readline().split()]
    matrix.append(a_i)
vector = []
for i in range(0, m):
    b_i = int(sys.stdin.readline())
    vector.append(b_i)

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

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

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

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

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

    product.append(total)

[print(p) for p in product]

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

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

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

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

    product.append(total)

[print(p) for p in product]

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

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

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

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

    product.append(total)

[print(p) for p in product]

Solution (Python):
n,m = map(int,raw_input().split())
mat = []
for k in range(n):
    mat.append(map(int,raw_input().split()))
b = []
for j in range(m):
    b.append(int(raw_input()))

for k in range(n):
    ans = 0
    for j in range(m):
        ans += mat[k][j]*b[j]
    print ans

Solution (Python):
if __name__ == '__main__':
    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)]
    c = [sum(map(lambda x,y: x*y, A[i], b)) for i in range(n)]
    print('\n'.join([str(i) for i in c]))

Solution (Python):


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

Solution (Python):


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

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

Solution (Python):
n,m=map(int,input().split())
matA=[list(map(int,input().split())) for i in range(n)]
matB=[int(input()) for i in range(m)]
for obj in matA:
	print(sum(obj[i] * matB[i] for i in range(m)))

Solution (Python):
import sys

n, m = [ int( val ) for val in sys.stdin.readline().split( " " ) ]
a = [ [ int( val ) for val in sys.stdin.readline().split( " " ) ] for row in range( n ) ]
b = [ [ int( val ) for val in sys.stdin.readline().split( " " ) ] for row in range( m ) ]

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

Solution (Python):
import sys

n, m = [ int( val ) for val in sys.stdin.readline().split( " " ) ]
a = [ [ int( val ) for val in sys.stdin.readline().split( " " ) ] for row in range( n ) ]
b = [ [ int( val ) for val in sys.stdin.readline().split( " " ) ] for row in range( m ) ]

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

Solution (Python):
n, m = map(int, raw_input().split())
A = [map(int, raw_input().split()) for i in xrange(n)]
B = [int(raw_input()) for i in xrange(m)]
for i in xrange(n):
    print sum(A[i][j] * B[j] for j in xrange(m))

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