Submit | All submissions | Best solutions | Back to list |
ZOOMOP - Zoom Operation |
Zoom Operation
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 classical at ZOOMOP2.
Added by: | Avinash |
Date: | 2012-04-12 |
Time limit: | 1s |
Source limit: | 512B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own Problem |