3112.Little Pony and Crystal Mine

Time Limit: 1s Memory Limit: 256MB

Twilight Sparkle once got a crystal from the Crystal Mine. A crystal of size n (n is odd; n \gt 1) is an n \times n matrix with a diamond inscribed into it.

You are given an odd integer n. You need to draw a crystal of size n. The diamond cells of the matrix should be represented by character "D". All other cells of the matrix should be represented by character "*". Look at the examples to understand what you need to draw.

Input Format(From the terminal/stdin)

The only line contains an integer n (3 \le n \le 101; n is odd).

Output Format(To the terminal/stdout)

Output a crystal of size n.

Sample Input 1

Copy
3
 \n

Sample Output 1

Copy
*D*
DDD
*D*
   \n
   \n
   \n

Sample Input 2

Copy
5
 \n

Sample Output 2

Copy
**D**
*DDD*
DDDDD
*DDD*
**D**
     \n
     \n
     \n
     \n
     \n

Sample Input 3

Copy
7
 \n

Sample Output 3

Copy
***D***
**DDD**
*DDDDD*
DDDDDDD
*DDDDD*
**DDD**
***D***
       \n
       \n
       \n
       \n
       \n
       \n
       \n

Submit

请先 登录

© 2025 FAQs