import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Iterator;

public class Main{
public static void main(String[] args){

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
ArrayList<ArrayList<Integer>> List = new ArrayList<ArrayList<Integer>>();


for(int i = 0 ; i < n ; i++){
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
}


ArrayList<Integer> List3 = new ArrayList<Integer>();

for(int i = 0 ; i < m ; i++){
  List3.add(sc.nextInt());

}//Input Vectors

int cnt=0;
for(ListIterator<ArrayList<Integer>> it = List.listIterator(); it.hasNext();){
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
}

}//main



}//class
 import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.ListIterator; ListIterator java.util import java.util.Iterator; Iterator java.util public class Main{
public static void main(String[] args){

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
ArrayList<ArrayList<Integer>> List = new ArrayList<ArrayList<Integer>>();


for(int i = 0 ; i < n ; i++){
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
}


ArrayList<Integer> List3 = new ArrayList<Integer>();

for(int i = 0 ; i < m ; i++){
  List3.add(sc.nextInt());

}//Input Vectors

int cnt=0;
for(ListIterator<ArrayList<Integer>> it = List.listIterator(); it.hasNext();){
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
}

}//main



}//class Main public static void main(String[] args){

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
ArrayList<ArrayList<Integer>> List = new ArrayList<ArrayList<Integer>>();


for(int i = 0 ; i < n ; i++){
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
}


ArrayList<Integer> List3 = new ArrayList<Integer>();

for(int i = 0 ; i < m ; i++){
  List3.add(sc.nextInt());

}//Input Vectors

int cnt=0;
for(ListIterator<ArrayList<Integer>> it = List.listIterator(); it.hasNext();){
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
}

}//main main {

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
ArrayList<ArrayList<Integer>> List = new ArrayList<ArrayList<Integer>>();


for(int i = 0 ; i < n ; i++){
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
}


ArrayList<Integer> List3 = new ArrayList<Integer>();

for(int i = 0 ; i < m ; i++){
  List3.add(sc.nextInt());

}//Input Vectors

int cnt=0;
for(ListIterator<ArrayList<Integer>> it = List.listIterator(); it.hasNext();){
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
}

} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int sum = 0; sum 0 ArrayList<ArrayList<Integer>> List = new ArrayList<ArrayList<Integer>>(); List new ArrayList<ArrayList<Integer>>() for(int i = 0 ; i < n ; i++){
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
} {
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
} ArrayList<Integer> List2 = new ArrayList<Integer>(); List2 new ArrayList<Integer>() for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
    List2.add(sc.nextInt());

  } {
    List2.add(sc.nextInt());

  } List2.add(sc.nextInt()) List2.add List2 sc.nextInt() sc.nextInt sc List.add(List2) List.add List List2 ArrayList<Integer> List3 = new ArrayList<Integer>(); List3 new ArrayList<Integer>() for(int i = 0 ; i < m ; i++){
  List3.add(sc.nextInt());

}//Input Vectors int i = 0 ; int i = 0 ; i 0 i < m i m i++ i++ i {
  List3.add(sc.nextInt());

}//Input Vectors {
  List3.add(sc.nextInt());

} List3.add(sc.nextInt()) List3.add List3 sc.nextInt() sc.nextInt sc int cnt=0; cnt 0 for(ListIterator<ArrayList<Integer>> it = List.listIterator(); it.hasNext();){
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
} ListIterator<ArrayList<Integer>> it = List.listIterator(); ListIterator<ArrayList<Integer>> it = List.listIterator(); it List.listIterator() List.listIterator List it.hasNext() it.hasNext it {
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
} {
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
} for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  } ListIterator<Integer> itt = (it.next()).listIterator(); ListIterator<Integer> itt = (it.next()).listIterator(); itt (it.next()).listIterator() (it.next()).listIterator (it.next()) it.next it itt.hasNext() itt.hasNext itt {

sum += (itt.next())*(List3.get(cnt));
cnt++;
  } {

sum += (itt.next())*(List3.get(cnt));
cnt++;
  } sum += (itt.next())*(List3.get(cnt)) sum (itt.next())*(List3.get(cnt)) (itt.next()) itt.next itt (List3.get(cnt)) List3.get List3 cnt cnt++ cnt cnt = 0 cnt 0 System.out.println(sum) System.out.println System.out System System.out sum sum = 0 sum 0 String[] args args public class Main{
public static void main(String[] args){

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
ArrayList<ArrayList<Integer>> List = new ArrayList<ArrayList<Integer>>();


for(int i = 0 ; i < n ; i++){
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
}


ArrayList<Integer> List3 = new ArrayList<Integer>();

for(int i = 0 ; i < m ; i++){
  List3.add(sc.nextInt());

}//Input Vectors

int cnt=0;
for(ListIterator<ArrayList<Integer>> it = List.listIterator(); it.hasNext();){
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
}

}//main



}//class public class Main{
public static void main(String[] args){

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
ArrayList<ArrayList<Integer>> List = new ArrayList<ArrayList<Integer>>();


for(int i = 0 ; i < n ; i++){
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
}


ArrayList<Integer> List3 = new ArrayList<Integer>();

for(int i = 0 ; i < m ; i++){
  List3.add(sc.nextInt());

}//Input Vectors

int cnt=0;
for(ListIterator<ArrayList<Integer>> it = List.listIterator(); it.hasNext();){
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
}

}//main



}//class Main
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Iterator;

public class Main{
public static void main(String[] args){

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
ArrayList<ArrayList<Integer>> List = new ArrayList<ArrayList<Integer>>();


for(int i = 0 ; i < n ; i++){
  ArrayList<Integer> List2 = new ArrayList<Integer>();
  for(int j = 0; j < m ; j++){
    List2.add(sc.nextInt());

  }
List.add(List2);
}


ArrayList<Integer> List3 = new ArrayList<Integer>();

for(int i = 0 ; i < m ; i++){
  List3.add(sc.nextInt());

}//Input Vectors

int cnt=0;
for(ListIterator<ArrayList<Integer>> it = List.listIterator(); it.hasNext();){
  for(ListIterator<Integer> itt = (it.next()).listIterator();itt.hasNext();){

sum += (itt.next())*(List3.get(cnt));
cnt++;
  }
cnt = 0;
System.out.println(sum);
sum = 0;
}

}//main



}//class

