Loading [MathJax]/jax/output/HTML-CSS/jax.js

Matrix Vector Multiplication


Write a program which reads a n×m matrix A and a m×1 vector b, and prints their product Ab.

A column vector with m elements is represented by the following equation.

b=(b1b2:bm)

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

A=(a11a12...a1ma21a22...a2m::::an1an2...anm)

i-th element of a m×1 column vector b is represented by bi (i=1,2,...,m), and the element in i-th row and j-th column of a matrix A is represented by aij (i=1,2,...,n, j=1,2,...,m).

The product of a n×m matrix A and a m×1 column vector b is a n×1 column vector c, and ci is obtained by the following formula:

ci=mj=1aijbj=ai1b1+ai2b2+...+aimbm

Input

In the first line, two integers n and m are given. In the following n lines, aij are given separated by a single space character. In the next m lines, bi is given in a line.

Output

The output consists of n lines. Print ci in a line.

Constraints

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