eolymp
bolt
Try our new interface for solving problems
Problems

Sum of matrices

Sum of matrices

Given two matrices $A$ and $B$. Find their sum $C = A + B$. \InputFile The first line contains the size of matrices $n$ and $m~(1 \le n, m \le 100)$. Each of the next $n$ lines contains $m$ integers and describe matrix $A$. Then empty line is given, after which the description of matrix $B$ is given in the same format. \OutputFile Print the matrix $С$: $n$ rows, each with $m$ integers.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3 4
3 4 5 6
1 2 3 4
7 6 5 4

0 0 -3 -2
-1 3 4 5
5 6 1 2
Output example #1
3 4 2 4 
0 5 7 9 
12 12 6 6 
Author Michael Medvedev