Problem D: Array - Matrix Vector Multiplication

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $409$ 正确数量 $303$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL 数学

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.

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

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:

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 mm lines, bi is given in a line.
The output consists of n lines. Print ci in a line.
3 4
1 2 0 1
0 3 0 1
4 1 1 0
1
2
3
0
5
6
9

1≤n,m≤100

0≤bi,aij≤1000