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

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


11. 50410 - Zero Padding

CEN_114 Midterm A

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

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

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

• 1. 50467 - Random Numbers
• 10. 51093 - rgb2gray
• 11. 50410 - Zero Padding
• 12. 50470 - Close Pairs - Revised
• 13. 50735 - Top M Products
• 14. 51094 - Passing the course
• 15. 50804 - Marathon
• 3. 50390 - Total Salary Paid
• 4. 50528 - Rock-Scissors-Paper
• 5. 51087 - Are they the same?
• 6. 51092 - Even and Odd

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

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

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

Zero Padding

Computer images usually contain tabular format with integers from 0 until 255 for 3 colors RGB. For processing purposes sometimes zeros are added all 4 sides of the image.

Question:
Write a program that receives two integers k and j and a two dimensional array. The program will add (k) columns of zeros before the first and after the last columns of the image. And also, the program will add (j) rows before the first and after the last rows.

Input specification
You will be given four integers (k,j, and m, n) at the beginning. where m and n is the width and height of the array and 1 ≤ (m and n) ≤ 80 and 0 ≤ (k and j) ≤ 10. On the next n lines you will have m integer numbers where each of the number is between 0 and 255.

Output specification
Show the zero padded array. The number will be space separated.

Sample Input I   
  2 1 3 4
  147 148 124
  156 241 84
  145 11 19
  200 232 6
Sample Output I   
  0 0 0 0 0 0 0
  0 0 147 148 124 0 0
  0 0 156 241 84 0 0
  0 0 145 11 19 0 0
  0 0 200 232 6 0 0
  0 0 0 0 0 0 0


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

www.contester.ru