POJ 2083 fractal: Fractal & partition

Source: Internet
Author: User
Tags time limit uppercase letter

Fractal

http://poj.org/problem?id=2083

Time limit:1000ms

Memory limit:30000k

Description

A fractal is an object or quantity this displays self-similarity, in a somewhat technical, on all sense. The object need not exhibit exactly the same structure in all scales, but the same "type" of structures must in all Scales. A box fractal is defined as below:

A box fractal of degree 1 is simply X

A box fractal of degree 2 is x × x x x

If using B (n-1) to represent the box fractal of degree n-1, then a box fractal of degree n is defined recursively as F Ollowing

B (n-1) b (n-1) b (n-1) b (n-1) b (n-1)

Your task is to draw a box fractal of degree n.

Input

The input consists of several test cases. Each line of this input contains a positive integer n which is no greater than 7. The last line of type negative integer 1 indicating the end of input.

Output

For each test case, output the box fractal using the ' X ' notation. Please notice the ' X ' is a uppercase letter. Print a line with a single dash for each test case.

Sample Input

1234-1

Sample Output

 

X-x x xx x-x x   x x     XX x   x x   x x    x   x xx x   x x x &NB Sp   XX x   x x-x x   x x         x x   x x x     x       &N Bsp   X     XX x   x x         x x   x x   x x         & nbsp     x x    x                 X   x x               X XX x   x x         x x   x x x     x           x     XX x   x x         x x   x x       &NBSP ; x x   x x          x     x         x x   x x   &NBSP ;        x X             X            x X &N Bsp      x x   x x          x     x         x x &N Bsp x XX x   x x         x x   x x x     x           x     XX x   x x         x x   x x   x x             &N Bsp x x    x                 X   x x               x XX x   x x         x x   x x x     x           x     XX x   x x         x x   x x

Source

Shanghai Preliminary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.