Input Format
The first line contains the integer .
The next  lines contains  space separated integers of array .
The following  lines contains  space separated integers of array .
Output Format
Print the matrix multiplication of  and .

hackerrank dot and cross problem solution in python

Problem solution in python 2 programming language.

import numpy

N = int(raw_input())
A = numpy.array([ map(int, raw_input().split()) for i in range(N) ])
B = numpy.array([ map(int, raw_input().split()) for i in range(N) ])

print numpy.dot(A, B)

Problem solution in python 3 programming language.

import numpy

N = int(input())
A = numpy.array([ map(int, input().split()) for i in range(N) ])
B = numpy.array([ map(int, input().split()) for i in range(N) ])

print(numpy.dot(A, B))