
matrix = []
vector = []
n, m = gets.split.map(&:to_i)

for i in 1..n
matrix.push(gets.split.map(&:to_i))
end

for i in 1..m
vector.push(gets.to_i)
end

for i in 1..n
sum = 0
for k in 1..m
sum += matrix[i-1][k-1] * vector[k-1]
end

puts sum

end


