#B4037. N-Shaped Matrix Construction
N-Shaped Matrix Construction
N-Shaped Matrix Construction
Construct an matrix (where 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 , the resulting matrix is:
+---+ ++--+ +-+-+ +--++ +---+
inputFormat
Input consists of a single odd integer (with ).
outputFormat
Print the constructed matrix. Each row must be printed on a new line.
sample
5
+---+
++--+
+-+-+
+--++
+---+
</p>