fun main(args: Array<String>) {
    val (row, column) = readLine()?.split(" ")?.map { it.toInt() } ?: return
    val matrix = Array(row, { intArrayOf() })
    (0 until row).forEach { i ->
        val rowElements = readLine()?.split(" ")?.map { it.toInt() }?.toIntArray() ?: return
        matrix.set(i, rowElements)
    }
    val columnVector = IntArray(column)
    (0 until column).forEach { i ->
        val columnVectorElement = readLine()?.toInt() ?: return
        columnVector[i] = columnVectorElement
    }
    val answerMatrix = IntArray(row)
    for ((index1, rowOfMatrix) in matrix.withIndex()) {
        for((index2, value) in rowOfMatrix.withIndex()) {
            var answer = answerMatrix.getOrElse(index1, { 0 })
            answer += columnVector.get(index2) * value
            answerMatrix.set(index1, answer)
        }
    }
    answerMatrix.forEach { it ->
        println(it)
    }
}
