

import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n, m, c, sum;
		n = scan.nextInt();
		m = scan.nextInt();
		c = 0;// list2??§?????¨
		sum = 0;// ?¨???????????¨??????§?????????
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

		// list1???(n*m)????????°????????\??????
		for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		}
		// list2???m????????°????????\??????
		for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		}

		// m??????????¨????
		for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		}
		System.out.print(new String(sb));

	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz