Page not loading? Try clicking here.
Placeholder

#6107

네모 디자인 1s 1024MB

Problems

Write a program that will generate Square Designs like the ones below for any values of M and N (1 ≤ M ≤ 18; 1 ≤ N ≤ 18). Exactly ten spaces separate the pair of boxes and the left box has no spaces in front of it. There are neither "tabs" nor trailing spaces in the output.

Here is the output for M=5 and N=3:

+-----------+          +-------+
I-X-X-X-X-X-I          I-X-X-X-I
I-X-X-X-X-X-I          I-X-X-X-I
I-X-X-X-X-X-I          I-X-X-X-I
I-X-X-X-X-X-I          +-------+
I-X-X-X-X-X-I
+-----------+

This output contains no blank lines.


Input

A single line containing two integers, M and N.


Output

Several output lines that create the design as shown above.


Example

2 6
+-----+          +-------------+
I-X-X-I I-X-X-X-X-X-X-I
I-X-X-I I-X-X-X-X-X-X-I
+-----+ I-X-X-X-X-X-X-I
I-X-X-X-X-X-X-I
I-X-X-X-X-X-X-I
I-X-X-X-X-X-X-I
+-------------+

Source

USACO 2001 Spring Orange 2번

You must sign in to write code.