A. 【例62.1】 矩阵加法

    Type: Default 1000ms 256MiB

【例62.1】 矩阵加法

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

Given two matrices AA and BB of size n×mn \times m, output their sum A+BA+B.

Input Format

First line contains two integers nn and mm, representing the number of rows and columns of the matrices. 1n1001 \le n \le 100, 1m1001 \le m \le 100.
Next nn lines, each containing mm integers, represent the elements of matrix AA.
Next nn lines, each containing mm integers, represent the elements of matrix BB.
Adjacent integers are separated by a single space, and each element is between 11 and 10001000.

Output Format

Output nn lines, each containing mm integers, representing the result of matrix addition. Adjacent integers are separated by a single space.

Sample

3 3
1 2 3
1 2 3
1 2 3
1 2 3
4 5 6
7 8 9
2 4 6
5 7 9
8 10 12

20251108C班作业(6)

Not Claimed
Status
Done
Problem
4
Open Since
2025-11-8 0:00
Deadline
2025-11-16 23:59
Extension
24 hour(s)