Problem list
Log in
#r03094 · Online Judge > GoldOJ

Add Two Matrices

Bronze III 2.0 s 1024 MB

Two $n \times m$ matrices are given (the first, then the second). Print their element-wise sum.

Input

Line 1: $n$ $m$. Next $n$ lines: matrix $A$. Next $n$ lines: matrix $B$.

Output

Print the sum matrix, rows on separate lines.

Example 1

Input
2 3
1 2 3
4 5 6
10 20 30
40 50 60
Output
11 22 33
44 55 66
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code