ZOOMOP2 - Zoom Operation

Zoom Operation

zoomop

zoomop

zoomop

Use only 4 symbols: + ? - # (in circular order beginning with +) to zoom the number given.

Every segment of the number has one symbol more than the previous. (First Segment has a single symbol).

First symbol of every segment starts in the same column/row where the previous segment's last symbol ends.

First segment (orange color) → 1 symbol + (first symbol only.)

Second segment (green color) → 2 symbols ? - (starts with second symbol as first segment uses single element.)

Third segment (yellow color) → 3 symbols # + ? (starts with fourth symbol as 3 symbols have been used by first and second segments.)

Colors are shown for better understanding. See picture for more clarification.

Input

Given a number you have to apply zoom operation and print it.

Output

Print the pattern after Zoom Operation.

Examples

Input:
1

Output:
+
Input:
2

Output:
  +?
   -
-?+#
#
+
?
-#+?-
Input:
3

Output:
   +?
    -
 -?+#
 #
 +
 ?
 -#+?-#
      +
      ?
      -
      #
      +
#-?+#-?
Input:
4

Output:
+
?-#
  +
  ?
Input:
5

Output:
 ?+
 -
 #+?-
    #
    +
    ?
-?+#-

For any clarification, refer to the picture above.

Try tutorial at ZOOMOP.


Added by:Avinash
Date:2012-04-14
Time limit:0.100s-1s
Source limit:256B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own Problem

hide comments
2012-08-25 16:22:04 mAddy
move it to challenge!
2012-04-16 18:03:38 Avinash
@Mitch:No linefeed.
2012-04-16 15:47:06 Mitch Schwartz
@Avinash: (...) tell us the exact way to format our answer. My formatting: Spaces are all conforming to image, no trailing spaces, and last line terminates with linefeed character.

--

Ok, thanks.

Last edit: 2012-04-17 06:15:06
2012-04-14 15:20:01 Avinash
@Pranay:8 is not in the inputs.and n<10.
2012-04-14 11:15:22 Pranay
does the input not consist of digit '8' ? and what is limit for n? Also if n>=10 then are two zoomed representations separated by a space?

Last edit: 2012-04-14 12:27:45
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.