- You are given for 1st matrix, no of rows(n1) and no of columns(m1)
- You are given n1*m1 numbers, representing elements of 2d array mat1.
- You are given for 2nd matrix, no of rows(n2) and no of columns(m2)
- You are given n2*m2 numbers, representing elements of 2d array mat2.
- If the two arrays can be multiplied, display the contents of multiplied array.
- Otherwise print "Invalid input".
Example 1:
Input: n1=2, m1=3, mat1[][] = {10, 0, 0, 0, 20, 0} n2=3, m2=4, mat2[][] = {1, 0, 1, 0, 0, 1, 1, 2, 1, 1, 0, 0}
Output: 10 0 10 0 0 20 20 40
Constraints:
1 <= n1 <= 10^2
1 <= m1 <= 10^2
-10^9 <= e11, e12, .. n1 * m1 elements <= 10^9
1 <= n2 <= 10^2
1 <= m2 <= 10^2
-10^9 <= e11', e12', .. n2 * m2 elements <= 10^9