#t53. 小杨的 H 字矩阵
小杨的 H 字矩阵
Xiao Yang's H-Matrix
Problem Description
Xiao Yang wants to construct an H-shaped matrix ( is odd). Specifically, this matrix has rows, each with characters, where the leftmost column and the rightmost column are both |, and the middle row (i.e. the -th row) has its 2nd to -th characters all -, while all remaining characters are the lowercase half-width letter a. For example, an H-matrix is as follows:
|aaa|
|aaa|
|---|
|aaa|
|aaa|
Please help Xiao Yang print the corresponding "H-matrix" for a given .
Input Format
One line with an integer (, it is guaranteed that is odd).
Output Format
Output the corresponding "H-matrix".
Strictly follow the required format; do not add any spaces, punctuation, blank lines, or any other symbols on your own. You must output exactly rows, each containing exactly characters besides the newline, and each character is either -, |, or a. Your output must match the standard answer exactly to score, so please check carefully before submitting.
Sample Input 1
5
Sample Output 1
|aaa|
|aaa|
|---|
|aaa|
|aaa|
Sample Input 2
7
Sample Output 2
|aaaaa|
|aaaaa|
|aaaaa|
|-----|
|aaaaa|
|aaaaa|
|aaaaa|
Sample Explanation
For :
- Rows 1, 2, 4, and 5: leftmost and rightmost are
|, with the middle characters beinga, i.e.|aaa|. - Row 3 is the middle row (); besides the leading and trailing
|, columns 2 to 4 are all-, so it is|---|. So the output is as shown in the sample.
Constraints
- , and is odd.