No.3703 Rotation
Problem Statement
Suuken-kun is playing "Suuken Quest", a game about exploring a map. Because of a display glitch, the screen has been rotated by 90 degrees, and he wants to restore it.
You are given a grid $G$ represented by $H$ strings $S_1,S_2,\cdots, S_H$ of length $W$ consisting only of . and #.
When the $j$-th character of $S_i$ is the character $c$, $c$ is written in the cell of $G$ that is $i$-th from the top and $j$-th from the left.
Output the $W$ strings $S'_1, S'_2, \cdots ,S'_W$ representing the new grid $G'$ obtained by rotating $G$ 90 degrees clockwise, according to the following format.
- When $c$ is written in the cell of $G'$ that is $i$-th from the top and $j$-th from the left, the $j$-th character of $S'_i$ is $c$.
Input
$H\ W$ $S_1$ $S_2$ $\cdots$ $S_H$
- $1 \le H, W \le 1000$.
- $H,W$ are integers.
- $S_i$ consists only of
.or#.
Output
Output $W$ lines. On the $i$-th line, output $S'_i$.
Do not output anything other than the answer. (Do not output text such as prompts for input.)
For the answer format, you may refer to the practice problems and their sample solutions, but note that no links are provided.
Sample
Sample 1
Input
5 6 ..#... .#.... ###### .#.... ..#...
Output
..#.. .###. #.#.# ..#.. ..#.. ..#..
Sample 2
Input
1 1 #
Output
#
Sample 3
Input
34 5 ##### ....# ...#. .##.. #.... ##### ..... #.#.# #.#.# #.#.# #.#.# #.#.# ##### ..... #...# .#.#. .#.#. ..#.. ..#.. ##### ..... ####. ....# ....# ....# ....# ####. ..... ...#. #.#.# #.#.# #.#.# #.#.# .#...
Output
.####..#....#.#....#.######.##...# #......#....#.#..##..#......#.#..# .####..#....#.###....######.#.#..# .....#.#....#.#..##..#......#..#.# .####...####..#....#.######.#...##
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。