#t94. 小杨的日字矩阵
小杨的日字矩阵
Xiaoyang's "Ri" Matrix
Problem Description
Xiaoyang wants to construct an "Ri" matrix (日, the Chinese character for "sun"; is odd). Specifically, this matrix has rows, each with characters. The leftmost column and the rightmost column are both |, while the first row, the last row, and the middle row (the -th row) have - for their -nd to -th characters; all the remaining characters are the half-width lowercase letter x. For example, an "Ri" matrix is as follows:
|---|
|xxx|
|---|
|xxx|
|---|
Please help Xiaoyang print the corresponding "Ri matrix" for the given .
Input Format
One line containing one integer (, and is guaranteed to be odd).
Output Format
Output the corresponding "Ri matrix".
Strictly follow the required format: do not add any spaces, punctuation, or other symbols on your own. You must output exactly lines, each line containing exactly characters besides the newline — each of which is either -, |, or x. Your output must match the standard answer exactly to get credit; please check carefully before submitting.
Sample Input
Sample Input 1
5
Sample Input 2
7
Sample Output
Sample Output 1
|---|
|xxx|
|---|
|xxx|
|---|
Sample Output 2
|-----|
|xxxxx|
|xxxxx|
|-----|
|xxxxx|
|xxxxx|
|-----|
Sample Explanation
For sample input 1, . The matrix has rows, each with characters.
The middle row is the rd row.
- The st and th rows (first and last): the leftmost and rightmost columns are
|, and the middle characters are-, so it is|---|. - The rd row (middle): likewise the leftmost and rightmost columns are
|, and the middle characters are-, so it is also|---|. - The nd and th rows: the leftmost and rightmost columns are
|, and the middle characters arex, so it is|xxx|.
So the output matrix is as shown above.
Constraints
For all test data, and is odd.