luogu#P5229. [AHOI2013] 立方体
[AHOI2013] 立方体
Problem Description
In a three-dimensional space, there are cubes. The -th cube occupies the region from to . These cubes may intersect or overlap. Together, they form a large geometric shape. Now, find the outer surface area of this shape.
Input Format
The first line contains an integer , representing the number of cubes.
Lines to each contain integers separated by spaces, representing , , , , , .
Output Format
Output one line containing an integer, representing the outer surface area.
1
0 0 0 1 1 1
6
2
0 1 0 3 2 1
1 0 0 2 3 1
22
Hint
All testdata satisfy .
.
.
.
Translated by ChatGPT 5