#K56442. Calculate User Returns

    ID: 30199 Type: Default 1000ms 256MiB

Calculate User Returns

Calculate User Returns

In this problem, you are given \(M\) users and \(N\) stocks. Each stock has a corresponding daily return and each user invests a certain amount in each stock. Your task is to compute the total daily return for each user. The formula to compute the total return for user \(i\) is given by:

\(R_i = \sum_{j=1}^{N}{r_j \times I_{ij}}\)

where \(r_j\) is the daily return of the \(j\)-th stock and \(I_{ij}\) is the investment of the \(i\)-th user in the \(j\)-th stock.

inputFormat

The first line contains two integers \(M\) and \(N\) separated by a space.

The second line contains \(N\) integers representing the daily returns for each stock.

Then follow \(M\) lines where each line contains \(N\) integers representing the investment amounts of each user in each stock.

outputFormat

Output \(M\) lines, where each line contains one integer representing the total return for that user.

## sample
3 3
10 20 30
100 200 300
400 500 600
700 800 900
14000

32000 50000

</p>