#B3986. Z Matrix
Z Matrix
Z Matrix
Little Z wants to create a \( n \times n \) Z matrix.
The matrix consists of \( n \) rows and \( n \) columns. The first row, the last row, and the anti-diagonal (i.e. the set of positions where the column index equals \( n - i + 1 \) for the \( i^{th} \) row) should be filled with the character Z
. All the other positions are filled with -
.
For example, when \( n = 6 \), the Z matrix is:
ZZZZZZ ----Z- ---Z-- --Z--- -Z---- ZZZZZZ
inputFormat
The input consists of a single integer \( n \) representing the size of the matrix.
Constraints: \( 1 \leq n \ \text{(reasonable bound)} \).
outputFormat
Output the Z matrix pattern in \( n \) lines. Each line should contain exactly \( n \) characters.
sample
3
ZZZ
-Z-
ZZZ
</p>