#B4037. N-Shaped Matrix Construction

    ID: 11694 Type: Default 1000ms 256MiB

N-Shaped Matrix Construction

N-Shaped Matrix Construction

Construct an m×mm \times m matrix (where mm is an odd integer) with a specific pattern: the first column, the main diagonal (from the top-left to bottom-right), and the last column are filled with the plus sign +, while all other positions are filled with the minus sign -.

For example, when m=5m=5, the resulting matrix is:

+---+
++--+
+-+-+
+--++
+---+

inputFormat

Input consists of a single odd integer mm (with m1m \geq 1).

outputFormat

Print the constructed m×mm \times m matrix. Each row must be printed on a new line.

sample

5
+---+

++--+ +-+-+ +--++ +---+

</p>