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

Турниры > CEN_114 Midterm B > задача:


11. 51089 - Multiply a row and add it to another

CEN_114 Midterm B

Старт: 14.мая.2020 в 00:00:01
Финиш: 31.мая.2020 в 23:59:59
Турнир завершён!
• Турнирная таблица

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

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

• 10. 51095 - Normal and Trace
• 11. 51089 - Multiply a row and ...
• 12. 50749 - Min Distance
• 13. 51124 - Easy Tiae words
• 14. 51136 - Class Average 2
• 15. 50734 - Product Info (In Srt)
• 2. 50453 - The Cubic Difference
• 3. 50346 - The Biggest Date
• 5. 50380 - Sum of the Numbers in t...
• 6. 50443 - Dajte Express

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

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

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

Multiply a row and add it to another

In gaussian elimination, the rows are multiplied with a constant and added over another. The following adds s times Rowi to Rowj

sRi + Rj --> Rj

Question: Write a program reads a 2D array and three integers (i, j and s). And calculates and prints the new array.

Input specification: First, you will be two integers: the number of rows (n) and the number of columns (m). Each of the following n lines will contain m integer. Then, you will be given 3 integers:(i, j and s) where m, n, i and j are between 2 and 100, s is between 1 and 100 the numbers in 2D array are between -1000 and +1000.

Output specification: Show the new 2D array.

Sample Input I Sample Input II
4 3
4 7 1
2 3 10
1 10 5
1 5 6
3 2 -2
3 4
-5 10 10 9
-10 -1 -7 2
2 -6 -3 -2
3 1 2
Sample Output I Sample Output II
4 7 1
0 -17 0
1 10 5
1 5 6
-1 -2 4 5
-10 -1 -7 2
2 -6 -3 -2

Explanation: In sample input I, there is 1 in the first array, but it does not exist in the second array. All the numbers in two arrays appears at least one in two arrays in the second sample.



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

www.contester.ru