Hot fish-shaped bun
Time limit1sMemory limit32 MB
Print the given N by M binary picture mirrored left to right.
- Level
Easy1 of 10
- Topics
- Matrix, Implementation
- Solved
- No attempts yet
Problem
Hodori, a first-year student at Korea University, walked past Anam Station and met a street vendor selling fish-shaped buns.
"Hi, hi, hi there, sir! Two fish buns, please."
"You said hi three times, so three fish buns!"
Hodori paid for two buns, got three, and was in a good mood. He pulled one out and took a bite, but it was so hot that he dropped it.

The bun landed mirrored left to right. Given the shape of the bun before the bite, print the shape it has once it lands.
Input
The first line holds two integers and separated by a space (, ).
Each of the next lines holds the shape of the bun. A line is a string of characters, where 0 is empty space and 1 is part of the bun. When is , each of those lines is empty.
Output
Print the bun mirrored left to right, on lines. When is , print nothing.
Hint
Reverse each line before printing it. Column 1 of row 1 in the input becomes column of row 1 in the output, column 2 of row 1 becomes column , and by the same rule column of row becomes column 1 of row .