object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val matrix = Seq.fill(n, m)(sc.nextInt())
  val vector = Seq.fill(m)(sc.nextInt())

  println(matrix.map(e => multiply(e, vector)).map(e => e.sum).mkString("\n"))

  def multiply(row: Seq[Int], vector: Seq[Int]): Seq[Int] = (0 to row.size - 1).map(i => row(i) * vector(i))
}