#include <iostream>
#include <vector>

using namespace std;

int main() {
  unsigned int m, n;
  cout << "m, n: "; cin >> m >> n;

  vector<double> b(n);
  cout << "b: ";
  for (auto& i: b)
    cin >> i;

  vector<vector<double>> a(m, vector<double>(n));
  for (unsigned int i = 0; i < m; i++) {
    cout << "a[" << i << "][...]: ";
    for (auto& j: a[i])
      cin >> j;
  }

  vector<double> c(m);
  vector<double>::iterator cpos = c.begin();

  for (auto i: a) {
    vector<double>::const_iterator bpos = b.begin();
    for (auto j: i)
      *cpos += j * *(bpos++);
    cpos++;
  }

  cout << "a*b: ";
  for (auto i: c)
    cout << i << " ";
  return 0;
}
