3178.Cardiogram

Time Limit: 1s Memory Limit: 256MB

In this problem, your task is to use ASCII graphics to paint a cardiogram. A cardiogram is a polyline with the following corners: 3178_1.png That is, a cardiogram is fully defined by a sequence of positive integers a1,a2,...,an.Your task is to paint a cardiogram by given sequence ai.

Input Format(From the terminal/stdin)

Input The first line contains integer n (2 \le n \le 1000). The next line contains the sequence of integers a1,a2,...,an (1 \le ai \le 1000). It is guaranteed that the sum of all ai doesn't exceed 1000.

Output Format(To the terminal/stdout)

Output Print max|yi-yj| lines (where yk is the y coordinate of the k-th point of the polyline), in each line print 3178_2.png characters. Each character must equal either «/» (slash), « \ » (backslash), « » (space). The printed image must be the image of the given polyline. Please study the test samples for better understanding of how to print a cardiogram.Note that in this problem the checker checks your answer taking spaces into consideration. Do not print any extra characters. Remember that the wrong answer to the first pretest doesn't give you a penalty.

Sample Input 1

Copy
5
3 1 2 5 1
 \n
 · · · · \n

Sample Output 1

Copy
 /\ /\/ \ / \ / \ \/
·  ·   · · · · · ·  \n

Sample Input 2

Copy
3
1 5 1
 \n
 · · \n

Sample Output 2

Copy
/\ \ \ \ \/
  · · · ·  \n

Hints

Due to the technical reasons the answers for the samples cannot be copied from the statement. We've attached two text documents with the answers below.http://assets.codeforces.com/rounds/435/1.txthttp://assets.codeforces.com/rounds/435/2.txt

Submit

请先 登录

© 2025 FAQs