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

Разделы > Поиск > задача:


50434 - Row Min Subtraction

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

Задачи раздела

• 50787 - Expected Value
• 50859 - Low performance
• 50785 - Swimming Contest
• 50826 - Olive Containers
• 50866 - Buy the cheapest
• 50999 - Overlapping Trips
• 50507 - Sequential Numbers
• 50501 - The Highest Average
• 50434 - Row Min Subtraction
• 50980 - The smallest rectangle
• 50860 - Number of Student Certificates
• 50832 - Rock Paper Scissors Lizard ...
• 50834 - The train which leaves the f...
• 51078 - Max trade
• 51056 - Welcome Picnic
• 51055 - The competition
• 51077 - Grades Histogram

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

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

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

Row Min Subtraction

In a research, your professor has realized that the data he is working on has some noise. For this reason, he wants to subtract the smallest value of every row from the row elements. As a result, the smallest number of every row will be 0.

Question: Write a program that is going to get n rows of m numbers. Then, the program will subtract the smallest value of every row from the row elements.
Note: Pay attention that there is memory limit in this question.

Input specification
In the beginning, you will be given 2 integers:

  • the number of rows (n): an integer between 0 and 5000
  • the number of numbers in every row (m): an integer between 0 and 1000
then in the following n lines you will be given m integers which are between -10000 and 10000.

Output specification
Show m integers in n lines.

Sample Input I
3 6
5 6 1 6 1 7
10 5 15 24 13 12
9 4 16 6 7 15
Sample Output I
4 5 0 5 0 6
5 0 10 19 8 7
5 0 12 2 3 11

Explanation: The min of first row is 1, thus, 1 has been subtracted from the first row elements.
The min of the second row is 5. Similarly, 5 has been subtracted from the second row elements...

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

www.contester.ru