P21046 [HackerRank] Np dot and cross
普及-
题目描述

dot

The dot tool returns the dot product of two arrays.

import numpy

A = numpy.array([ 1, 2 ])
B = numpy.array([ 3, 4 ])

print numpy.dot(A, B) #Output : 11

cross

The cross tool returns the cross product of two arrays.

import numpy

A = numpy.array([ 1, 2 ])
B = numpy.array([ 3, 4 ])

print numpy.cross(A, B) #Output : -2

Task

You are given two arrays $\mbox{A}$ and $\mbox{B}$. Both have dimensions of $N$X$N$.

Your task is to compute their matrix product.

Input Format

The first line contains the integer $N$.

The next $N$ lines contains $N$ space separated integers of array $\mbox{A}$.

The following $N$ lines contains $N$ space separated integers of array $\mbox{B}$.

Output Format

Print the matrix multiplication of $\mbox{A}$ and $\mbox{B}$.

Sample Input
2
1 2
3 4
1 2
3 4

Sample Output
[[ 7 10]
[15 22]]

输入格式

见题面

输出格式

见题面

样例输入
2 1 2 3 4 1 2 3 4
样例输出
[[ 7 10] [15 22]]