Problem:


  MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});

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.

\[
  b = \left(
    \begin{array}{c}
      b_1  \\
      b_2  \\
      : \\ 
      b_m \\ 
    \end{array}
  \right)
\]

  A $n \times m$ matrix with $m$ column vectors, each of which consists of $n$ elements, is represented by the following equation.

\[
  A = \left(
    \begin{array}{cccc}
      a_{11} & a_{12} & ... & a_{1m} \\
      a_{21} & a_{22} & ... & a_{2m} \\
       :    &   :   &  :  &  : \\
      a_{n1} & a_{n2} & ... & a_{nm} \\
    \end{array}
  \right)
\]

  $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:

\[
c_i = \sum_{j=1}^m a_{ij}b_j  = a_{i1}b_1 + a_{i2}b_2 + ... + a_{im}b_m
\]

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



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

Submission status: Accepted

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

#print(a)
#print(b)

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

Submission status: Accepted

Solution code:
def resolve():
    n, m = map(int, input().split())
    a = []
    b = []

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

    for _ 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][0]
        print(s)


resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
dataset = input().split(" ")
n = int(dataset[0])
m = int(dataset[1])

A = []
b = []
for i in range(n):
    dataset = input().split(" ")
    for j in range(m):
        A.append(int(dataset[j]))

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



answer = []

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

    answer.append(row_sum)

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

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

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

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
def mul(m, v):
    ans = []
    for row in m:
        a = 0
        for i in range(len(row)):
            a += row[i] * v[i]
        ans.append(a)
    return ans


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

matrix = []
vector = []

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

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

ans = mul(matrix, vector)

for e in ans:
    print(e)

Submission status: Accepted

Solution code:
n, m = list(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):
  s = 0
  for x in range(m):
    s += A[i][x] * b[x]
  print(s)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=[]
for i in range(a):
    c.append(list(map(int,input().split())))
#print(c)
d=[]
for i in range(b):
    d.append(int(input()))
for i in range(a):
    sum=0
    for j in range(b):
        sum+=c[i][j]*d[j]
    print(sum)

Submission status: Accepted

Solution code:
import sys
n,m = map(int,input().split())
line = []
for _ in range(n):
    data = [int(i) for i in sys.stdin.readline().strip().split(" ")]
    line.append(data)
b = []
for _ in range(m):
    data = int(sys.stdin.readline().strip())
    b.append(data)

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

Submission status: Accepted

Solution code:
rows,cols = map(int, input().split())

matrix = [[0 for r in range(cols)] for c in range(rows)]
vector =  [0 for c in range(cols)]

for row in range(rows):
    vs = list(map(int, input().split()))
    for index, value in enumerate(vs):
        matrix[row][index] = value

for col in range(cols):
    v = int(input())
    vector[col] = v

for row in range(rows):
    output = 0
    for col in range(cols):
        output += matrix[row][col] * vector[col]
    print(output)

Submission status: Accepted

Solution code:
a = []
b = []
c = []
calc = 0

n, m = map(int, input().split())
i = 0
j = 0

while i < n:
    a.append(list(map(int, input().split())))
    i += 1

while j < m:
    b.append(int(input()))
    j += 1

i = 0
j = 0
while i < n:
    calc = 0
    j = 0
    while j < m:
        calc += a[i][j] * b[j]
        j += 1 
    c.append(calc)
    i += 1

i = 0
while i in range(len(c)):
    print(c[i])
    i += 1

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
n, m = map(int,input().split())
a = []
e = []
for i in range(n):
    b = list(map(int,input().split()))
    a += b
for i in range(m):
    d = int(input())
    e.append(d)
for i in range(0,len(a),m):
    g = 0
    for j in range(m):
        f = a[i+j]*e[j]
        g += f
    print(g)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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)

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A = []
B = []
for n in range(N):
    tmp = list(map(int, input().split()))
    A.append(tmp)
for m in range(M):
    B.append(int(input()))

for n in range(N):
    combined = [x * y for (x, y) in zip(A[n], B)]
    print(sum(combined))

Submission status: Accepted

Solution code:
n, m = [int(line) for line in 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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def vector_multiplication(A, B):
    res = [[0 for _ in range(len(B[0]))] for _ in range(len(A))]
    for i in range(len(A)):
        for j in range(len(B[0])):
            for k in range(len(B)):
                res[i][j] += A[i][k] * B[k][j]
    return res


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

Submission status: Accepted

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

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


for ki in range(n):
    k=0
    for no in range(m):
        k+=A[ki][no]*b[no][0]
    c.append(k)

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

Submission status: Accepted

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

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

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

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

for a in answer:
  print(a)

Submission status: Accepted

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

matrix = list()
vector = list()

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

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

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

Submission status: Accepted

Solution code:
n, m = list(map(int, input().split()))
list_gyouretsu = []
for i in range(n):
  g = list(map(int, input().split()))
  list_gyouretsu.append(g)
  g = []
list_gyou = []
for j in range(m):
  list_gyou.append(int(input()))
for k in range(n):
  sum = 0
  for l in range(m):
    sum += list_gyouretsu[k][l]*list_gyou[l]
  print(sum)

Submission status: Accepted

Solution code:
N, M = [int(n) for n in input().split()]
A = []
for i in range(N):
  A.append([int(n) for n in input().split()])
b = []
for j in range(M):
  b.append(int(input()))
for k in range(N):
  ans = 0
  for l in range(M):
    ans += A[k][l] * b[l]
  print(ans)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
c = []
for _ in range(a):
    aa = list(map(int, input().split()))
    c.append(aa)
d = []
for i in range(a+1,a+b+1):
    bb = int(input())
    d.append(bb)

for n in range(a):
    x = 0
    y = 0
    for j in range(b):
        y = d[j] * c[n][j]
        x = x + y
    print(x)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

for i in result:
    print(i)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

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

c = []

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

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

Submission status: Accepted

Solution code:
n_row, n_column = map(int, input().split())
A = [[int(i) for i in input().split()] for _ in range(n_row)]
b = [int(input()) for _ in range(n_column)]

# target: n*m * m*1 -> n*1
ans = [0 for _ in range(n_row)]

for i_A_row, A_row in enumerate(A):
    # print(f"i_A_row: {i_A_row}")
    # print(f"A_row: {A_row}")
    # print(f"b:     {b}\n")
    for i in range(n_column):
        ans[i_A_row] += A_row[i] * b[i]
        
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
row, column = map(int, input().split())
matrix = [[0] * column for i in range(row)]
vector = [0]*column
for r in range(row):
    temporary = list(map(int, input().split()))
    for c in range(column):
        matrix[r][c] = temporary[c]
for c in range(column):
    vector[c] = int(input())

for r in range(row):
    ans=0
    for c in range(column):
        ans += matrix[r][c]*vector[c]
    print(ans)

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
vl = [int(input()) for _ in range(m)]

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split(" "))
alist = []
blist = []
for _ in range(n):
    anew = list(map(int,input().split(" ")))
    alist.append(anew)
for _ in range(m):
    bnew = int(input())
    blist.append(bnew)
sums = 0
for i in range(n):
    for j in range(m):
        sums += alist[i][j] * blist[j]
    print(sums)
    sums = 0

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

for i in range(n):
    temp = []
    for x, y in zip(parade[i], vec):
        temp.append(x * y)
    print(sum(temp))

Submission status: Accepted

Solution code:
# coding: utf-8
#69

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

#print(A,B)

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a_t = [list(map(int, input().split())) for _ in range(n)]
b_l = [int(input()) for _ in range(m)]
l = [0] * n

for i, a in enumerate(a_t):
    for j, k in enumerate(a):
        l[i] = (k * b_l[j]) + l[i]

for l in l:
    print(l)

Submission status: Accepted

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

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

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

for k in range(n):
    print(int(sum(list(map(lambda x,y: x*y, a[k], b)))))

Submission status: Accepted

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

result = []
for row in range(m):
    v = 0
    for col in range(n):
        v += (A[row][col] * b[col])
    result.append(v)

print('\n'.join(list(map(str,result))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
y,x=map(int,input().split())
var = []
for n in range(y):
    var.append(list(map(int,input().split())))
temp = []
for n in range(x):
    temp.append(int(input()))
for n in range(y):
    num = 0
    for m in range(x):
        num+=var[n][m]*temp[m]
    print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
rows, cols = (int(x) for x in input().split())

mat = []
for r in range(rows):
    line = input().split()
    row = [int(x) for x in line]
    mat.append(row)
#     print(mat)

v = []
for r in range(cols):
    v.append(int(input()))

out = [int(0)] * rows
for r in range(rows):
    for c in range(cols):
#         print(mat[r])
        out[r] += mat[r][c] * v[c]
    print(int(out[r]))

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
A, B = [], []

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

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

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

Submission status: Accepted

Solution code:

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

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

for i in range(n):
    aa = input().split() #空白で区切られているのをinput
    aa = [int(x) for x in aa] #aaの中身をintに変換
    for j in range(m):
        a[i][j]=aa[j]

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

Submission status: Accepted

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

a = [input().split() for l in range(n)]
b = [input().split() for l in range(m)]

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
lst=[]
for i in range(n):
    lst.append(input().split())
lst2=[]
for i in range(m):
    lst2.append(int(input()))
lst3=[]
for i in range(n):
    lst3=lst[i]
    c=0
    for i in range(m):
        c+=int(lst3[i])*lst2[i]
    print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

def main():
    a,b = map(int, input().split())
    
    A = []
    for i in range(a):
        s = list(map(int, input().split()))
        A.append(s)
    
    B = []
    for i in range(b):
        s = int(input())
        B.append(s)
    
    for i in range(a):
        c = 0
        for k in range(b):
            c += A[i][k] * B[k]
        print(c)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

A = []
b = []
total = 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):
        total += A[i][j] * b[j]
    print(total)
    total = 0

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
n,m=[int(x) for x in input().split()]
arrays=[]
bectors=[]
for s in range(n):
	arrays.append([int(x) for x in input().split()])

for p in range(m):
	bectors.append(int(input()))
	# bectors.append([int(x) for x in input().split()])



for v in arrays:
	_sum_=0
	for i,x in enumerate(v):
		_sum_+=x*bectors[i]

	print(_sum_)

Submission status: Accepted

Solution code:

def exe_matrix():
    n,m=tuple(map(int,input().split()))
    
    A=[]
    
    for i in range(n):
        row=list(map(int,input().split()))
        
        A.append(row)
        
    v=[]
    
    for i in range(m):
        x=int(input())
        v.append(x)
        
        
    out=[0 for i in range(n)]
    
    for i in range(n):
        for j in range(m):
            out[i]+=A[i][j]*v[j]
            
            
    for i in out:
        print(i)


exe_matrix()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!


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

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

#print(A)
#print(B)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a = []

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

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

Submission status: Accepted

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

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

cntn = 0

while cntn <= n - 1:
    A[cntn] = list(map(int, input().split()))
    cntn += 1

cntm = 0

while cntm <= m - 1:
    b[cntm] = int(input())
    cntm += 1

for idxn in range(n):
    result = 0
    for idxm in range(m):
        result += A[idxn][idxm] * b[idxm]
    print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
listA = []
listB = []
Answer = []
n, m = map(int, input().split())
for i in range(n):
    listA.append(list(map(int, input().split())))
for j in range(m):
    listB.append(int(input()))
for k in range(n):
    result = 0
    for l in range(m):
        result += listA[k][l]*listB[l]
    Answer.append(result)
for p in range(n):
    print(Answer[p])

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = []

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

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

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

Submission status: Accepted

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

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

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

C = []
for i in range(n):
    ci = 0
    for j in range(m):
        a = A[i]
        c = a[j]*B[j]
        ci += c
    C.append(ci)

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

Submission status: Accepted

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

Submission status: Accepted

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

num_list = []

for _ in range(n):
    num_list.append(list(map(int,input().split())))
    
gyou = [int(input()) for _ in range(m)]


for i in range(n):
    ans = 0
    for j in range(m):
        ans += num_list[i][j] * gyou[j]
    print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
N,M = [int(i) for i in input().split()]
a = []
b = []
c = []

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

for i in range(M):
    y = int(input())
    b.append(y)

for i in range(N):
    z = 0
    for j in range(M):
        z += a[i][j] * b[j]
    c.append(z)

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