Under construction

Still being built. Things may change

Square Designs

Time limit1sMemory limit1024 MB

Summary
Given M and N, print two square boxes side by side, the left with M cells across and the right with N, drawn with plus, minus, and I characters.
Level

Easy2 of 10

Topics
Implementation, String
Solved
No attempts yet

Problem

Write a program that generates a square design like the ones below for any values of M and N (1≤M≤181 \le M \le 18, 1≤N≤181 \le N \le 18). Exactly ten spaces separate the two boxes, and the left box has no spaces in front of it. The output has no tabs and no trailing spaces.

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 lines that draw the design as shown above.

Examples1

  1. Example 1

    Input
    2 6
    
    Expected output
    +-----+          +-------------+
    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
                     +-------------+