T388155 Cube(Easy)
题目背景
Tom really likes cubes, so he wants you to help him draw some cubes.
Tom 很喜欢正方体,所以他想请你帮他画正方体。
题目描述
Tom has $n$ cubes in total, where the $i$-th cube is located at a triplet $(x_i,y_i,z_i)$, where $x_i$ represents the horizontal coordinate of the $i$-th cube, $y_i$ represents the vertical coordinate of the $i$-th cube, and $z_i$ represents its depth in the view, as shown in the Figure below:

All coordinates start from $1$, and the edge length of the $i$-th cube is denoted as $a_i$, and it has an index $opt_i$ that determines whether the cube is transparent or not. When $opt_i$ is $1$, it means that it is transparent; if it is $0$, then it is not transparent.
Under the following two cases, figure out the appearance of the final graphics according to Tom's left vision:
1. Non-transparent
```
See attachment1.txt
```
2. Transparent
```
See attachment2.txt
```
The occlusion relationship is expressed as the following rules:
- A cube in the front can occlude the cube in the back;
- A cube on the right-hand side can occlude the cube on the left-hand side;
- A cube on the top can occlude the cube at the bottom.
```
See attachment3.txt
```
Tom will tell you the information of these $n$ cubes. Now he wants to know what the final volume shape will look like.
Tom 共有 $n$ 个正方体,其中第 $i$ 个正方体的坐标为一个形如 $(x_i,y_i,z_i)$ 的三元组,其中 $x_i$ 表示第 $i$ 个正方体的横坐标,$y_i$ 表示第 $i$ 个正方体的纵坐标,$z_i$ 表示其在视野中向后延申的长度,如下图:

所有坐标均从 $1$ 开始,同样,第 $i$ 个正方体的边长为 $a_i$,有一个指数 $opt_i$ 决定这个正方体是否透明,当 $opt_i$ 为 $1$ 时,表示透明,为 $0$ 则不透明。
组成正方体的字符如下:
- `+` 构成顶角;
- `|` 构成竖边;
- `-` 构成横边;
- `/` 构成斜边;
一个边长为 $1$ 的正方体的一条竖边为 $3$ 个 `|`,一条横边为 $7$ 个 `-`,一条斜边为一个 `/`,所有正方体的一个顶点均为一个 `+`,在视野中,一个边长为 $1$ 的正方体的斜着的边由两个顶点和一个 `/`组成,所以,我们把该正方体的斜着的边的长度看作是 $3$ ,即,在 $z$ 方向上,$z_i$ 为 $1$ 的含义是实际距离,而不是正方体本应由的边长的距离,即输出来是多长就是多长,不需要根据边长二次计算。
视角如下(以边长为 $1$ 为例,其他边长等比放大,顶点不变):
1. 不透明
```
见附件1.txt 13.png
```
2. 透明
```
见附件2.txt 14.png
```
遮挡关系如下:
- 前面的会遮挡后面的
- 右边的会遮挡左边的
- 上面的会遮挡下面的
```
见附件3.txt 11.png
```
Tom 会告诉你这 $n$ 个正方体的信息,现在他想要知道,最终他得到的立体图形的形状。
输入格式
The input consists of:
- The first line contains an integer $n$;
- The following $n$ lines, each containing $5$ integers $x_i$, $y_i$, $z_i$, $a_i$, and $opt_i$, which describe the information of a cube.
第一行一个整数 $n$;
接下来 $n$ 行,每行 $5$ 个整数 $x_i$、$y_i$、$z_i$、$a_i$、$opt_i$,描述一个正方体的信息。
输出格式
An illustration that represents the current 3D model is required. There should not be any extra spaces. The range of $x$ should be $1$ to $\max_{i=1}^n(x_i+7a_i+3)$, and the range of $y$ should be $1$ to $\max_{i=1}^n(y_i+3a_i+1)$.
一个图案,表示当前的立体图形。不输出多余空格,即,图案的 $x$ 的范围为 $1\sim$$max_i^n (x_i+7a_i+3)$, $y$ 的范围为 $1\sim$$max_i^n (y_i+3a_i+1)$。
说明/提示
$1\leq n\leq 500$;
$1\leq x_i\leq 500$;
$0\leq z_i\leq 50$;
$1\leq a_i\leq 20$;
$3a_i+2\leq y_i\leq 500$
$opt\in \{0,1 \}$