Problem list
Log in
#coci00566 · COCI 2020/2021 Contest 2

Crtanje

Silver V 1.0 s 512 MB

Josip used to code in Logo. He loved to draw pictures, but those days are sadly over. Nostalgic, he decided to draw a line that represents the net worth of his company over a period of $n$ days. For each of the $n$ days, he knows if the net worth of his company increased by one unit (represented by ’+’), decreased by one unit (represented by ’-’), or remained the same (represented by ’=’) during that day. Before the first day, the net worth was equal to zero. Josip will draw the line in a big infinite matrix of characters. Indices of matrix rows grow upwards, and indices of columns grow to the right. For the $i$-th day he will draw some character in the $i$-th column. The character and the index of the row are decided by the following rules:

  • If the net worth increased during the $i$-th day, he will draw ’/’ in the row with index equal to the net worth at the beginning of the day.
  • If the net worth decreased during the $i$-th day, he will draw ’\’ in the row with index equal to the net worth at the end of the day.
  • If the net worth didn’t change during the $i$-th day, he will draw ’’ in the row with index equal to the net worth during the day. All other cells are filled with ’.’. Your task is to output the minimal matrix that contains the whole line, i.e. contains all characters ’/’, ’\’ and ’’ that Josip drew.

Input

The first line contains an integer $n$ ($1 \le n \le 100$), the number of days. The second line contains a string of $n$ characters ’+’, ’-’ and ’=’ that represents how the company’s net worth changed over the given period.

Output

Output the described matrix.

Constraints

In test cases worth 20 points the input won’t contain the character ’-’.

Example 1

Input
7
++---==
Output
./\....
/..\...
....\__

Example 2

Input
5
+=+=+
Output
..._/
._/..
/....

Example 3

Input
4
--=+
Output
\...
.\_/
Source
COCI 2020/2021 Contest 2
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code