407187: GYM102697 158 Dot Product
Description
For this problem, you will be tasked with finding the dot product of two given matrices. Dot products are a very common matrix operation, and find uses in many fields of math, computer science, and physics. If you haven't had any experience with a matrix in the past, think of matrices as a "table" of values, similar to a multi-dimensional array. Matrices can be of any dimension, yet this problem will only focus on two dimensional matrices. The result of a dot product operation on two matrices m1 and m2 in the form m1*m2 will result in a matrix with the same number of rows as m1, and the same number of columns as m2. It is difficult to explain the computation of the dot product in text, so here is an image representing it:
The first line contains four space separated integers, representing the width of m1, the height of m1, the width of m2, and the height of m2 respectively. The next lines will contain each row of m1 followed by each row of m2. Each row will include space separated integers that correspond to the values in that row of the matrix.
OutputA single matrix that represents the result of computing the dot product of m1 and m2.
ExampleInput2 2 2 2 1 2 3 4 5 6 7 8Output
19 22 43 50