LearnPy Hub
← Arena
IntermediateRating 1300

Zero the Lines

If a cell is 0, set its whole row and column to 0. Print the result.

Input

r c, then r lines.

Output

r lines.

Sample 1

Input
3 3
1 1 1
1 0 1
1 1 1
Output
1 0 1
0 0 0
1 0 1

Sample 2

Input
2 4
0 1 2 0
3 4 5 2
Output
0 0 0 0
0 4 5 0
solution.py
Output appears here
Zero the Lines · Python Arena problem · LearnPy Hub