#K66907. Print X Pattern

    ID: 32524 Type: Default 1000ms 256MiB

Print X Pattern

Given an odd integer \(N\) (where \(3 \le N \le 101\)) provided via standard input, your task is to print an \(N \times N\) grid that forms the letter X. The grid should have '#' characters on the two diagonals and '.' characters everywhere else. Specifically, the conditions for printing '#' are when \(i = j\) or \(i+j = N-1\), where \(i\) and \(j\) denote the row and column indices (starting from 0).

For example, for \(N = 5\), the output should be:

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

Make sure to read the input from stdin and print the output to stdout without any extra characters.

inputFormat

The input consists of a single odd integer \(N\) (\(3 \leq N \leq 101\)) provided via standard input.

outputFormat

Print the resulting \(N \times N\) grid. Each row of the grid should be printed on a new line. Print a '#' at positions where \(i = j\) or \(i+j=N-1\) and a '.' at all other positions.

## sample
3
#.#

.#. #.#

</p>