HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN_114 Midterm B > problem:


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

CEN_114 Midterm B

Start: May.14.2020 at 12:00:01 AM
Finish: May.31.2020 at 11:59:59 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 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

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
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