ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > "Informatics Stars" Online Contests - 2011-2014 > задача:


50326 - Matrix Operations

"Informatics Stars" Online Contests - 2011-2014

Старт: 20.окт.2012 в 10:00:00
Финиш: 20.окт.2012 в 15:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 50326 - Matrix Operations
• 50325 - How much time passed?
• 50776 - Numri i rrugeve te ndryshm...
• 50779 - Rruga me e shkurter ne lab...
• 2011-04-1. 50586 - Palindrome te th...
• 2011-04-2. 50585 - Prodhimi i brend...
• 2011-04-3. 50587 - Shnderrimi i n...
• 2011-05-1. 50767 - Censura
• 2011-05-2. 50652 - Faktorizimi ne n...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by Ibrahim Mesecan.

Matrix Operations

Professor Erind is having frequently matrix operations and he wants to develop a program for this purpose. He wants the program to read two matrices, then sum of the matrices to printed out.

Question:
Write a program that is going to read two matrices (A and B) then show the result of A + B. Note that the sum operation is the sum of every element of Matrix A with respective element of Matrix B.

Input specification
In the first line, you will be given the size of the two matrices: two integers m (the number of rows) and n (the number of columns) where 1 < m,n ≤ 100 and the elements of the matrices are less than 1000.

The following m rows contain n numbers for the first matrix. And then, the following m rows contain n integers for the second matrix.

Output specification
As the output, give m rows with n integers which is the sum of the two matrices

Sample Input I
  2 4
  1 3 5 2
  0 2 6 4
  8 9 3 7
  4 0 0 3


Sample Output I  
  9 12 8 9
  4 2 6 7

Sample Input II  
  3 4
  8 9 2 9
  9 6 5 1
  1 0 9 9
  9 1 7 0
  4 4 9 8
  8 9 6 9

Sample Output II
  17 10 9 9
  13 10 14 9
  9 9 15 18


Для отправки решений необходимо выполнить вход.

www.contester.ru