435C.md (2003B)
1 Source: https://codeforces.com/problemset/problem/435/C 2 3 C. Cardiogram 4 5 time limit per test 6 7 1 second 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 In this problem, your task is to use ASCII graphics to paint a cardiogram. 22 23 A cardiogram is a polyline with the following corners: 24 25  26 27 That is, a cardiogram is fully defined by a sequence of positive integers *a*1, *a*2, ..., *a**n*. 28 29 Your task is to paint a cardiogram by given sequence *a**i*. 30 31 Input 32 33 The first line contains integer *n* (2 ≤ *n* ≤ 1000). The next line contains the sequence of integers *a*1, *a*2, ..., *a**n* (1 ≤ *a**i* ≤ 1000). It is guaranteed that the sum of all *a**i* doesn't exceed 1000. 34 35 Output 36 37 Print *max* |*y**i* - *y**j*| lines (where *y**k* is the *y* coordinate of the *k*-th point of the polyline), in each line print  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. 38 39 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. 40 41 Examples 42 43 Input 44 45 ``` 46 5 47 3 1 2 5 1 48 ``` 49 50 Output 51 52 ``` 53 / \ 54 / \ / \ 55 / \ 56 / \ 57 \ / 58 ``` 59 60 Input 61 62 ``` 63 3 64 1 5 1 65 ``` 66 67 Output 68 69 ``` 70 / \ 71 \ 72 \ 73 \ 74 \ / 75 ``` 76 77 Note 78 79 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. 80 81 http://assets.codeforces.com/rounds/435/1.txt 82 83 http://assets.codeforces.com/rounds/435/2.txt