1957: The Empire's Absolute Defense

文件提交:无需freopen 内存限制:1024 MB 时间限制:3.000 S
评测方式:普通裁判 命题人:
提交:11 解决:1

题目描述

In the distant depths of the galaxy, Commander Alban, the highest leader of the Galactic Empire, is facing a critical mission. The Empire's flagship, codenamed "Dark Star," is equipped with an advanced interstellar defense system. This system is represented by a grid of N rows and N columns, where the color of each cell signifies the strength of the defense system. 

Each cell can be painted black (#), representing powerful defense, or white (.), representing weaker defense. With the imminent threat of the Nether Legion's attack, Alban has decided to reset the defense grid and enhance the fleet's defensive capabilities.

 This operation will be executed through a series of precise calculations and color resets, as follows: For each i = 1, 2, ..., N/2, Alban must adjust the defense system in the following way:
    -For all pairs of integers x, y between i and N+1-i, the color of cell (y, N+1-x) is replaced with the color of cell (x, y). 

This operation is executed simultaneously to ensure that every cell of the defense system is swiftly reset. Alban knows that this operation will significantly enhance the fleet's defense. By using this method, the defense grid will be fully reinforced before the Nether Legion launches its attack, ensuring the safety of the Empire and the victory of the future.

输入

input:
The input is given from Standard Input in the following format:
N

A(1,1) , A(1,2)…A(1,N) 

A(2,1), A(2,2)… A(2,N) 

. . . 

A(N,1), A(N,2)… A(N,N)

输出

After all operations, let B(i,j) ‎ =  # if cell(I, j) is black, and B(i,j) ‎ =  . if it is white. Print the grid in the following format: B(1,1) , B(1,2)…B(1,N) 

B(2,1), B(2,2)… B(2,N) 

. . .

B(N,1), B(N,2)…B(N,N)

样例输入

8
.......#
.......#
.####..#
.####..#
.##....#
.##....#
.#######
.#######

样例输出

........
#######.
#.....#.
#.###.#.
#.#...#.
#.#####.
#.......
########

提示

The operations change the colors of the grid cells as follows:
.......#   ........   ........   ........   ........
.......#   ######..   #######.   #######.   #######.
.####..#   ######..   #....##.   #.....#.   #.....#.
.####..# → ##..##.. → #....##. → #.##..#. → #.###.#.
.##....#   ##..##..   #..####.   #.##..#.   #.#...#.
.##....#   ##......   #..####.   #.#####.   #.#####.
.#######   ##......   #.......   #.......   #.......
.#######   ########   ########   ########   ########

Constraints

  • N is an even number between 2 and 3000, inclusive.
  • Each Ai,j is # or ..

来源/分类