#abc312e. E - Tangency of Cuboids
E - Tangency of Cuboids
Score : points
问题描述
在三维空间中有 个长方体。
这些长方体之间互不重叠。形式地说,对于其中任意两个不同的长方体,它们的交集体积为 。
第 个长方体的对角线是一条连接两点 和 的线段,其边都与某一坐标轴平行。
对于每个长方体,找出与其共面的其他长方体的数量。 形式上来说,对于每个 ,找出满足条件 且 的 的数量,使得第 个和第 个长方体表面的交集具有正面积。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are rectangular cuboids in a three-dimensional space.
These cuboids do not overlap. Formally, for any two different cuboids among them, their intersection has a volume of .
The diagonal of the -th cuboid is a segment that connects two points and , and its edges are all parallel to one of the coordinate axes.
For each cuboid, find the number of other cuboids that share a face with it.
Formally, for each , find the number of with and such that the intersection of the surfaces of the -th and -th cuboids has a positive area.
Constraints
- Cuboids do not have an intersection with a positive volume.
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
4
0 0 0 1 1 1
0 0 1 1 1 2
1 1 1 2 2 2
3 3 3 4 4 4
Sample Output 1
1
1
0
0
The -st and -nd cuboids share a rectangle whose diagonal is the segment connecting two points and .
The -st and -rd cuboids share a point , but do not share a surface.
Sample Input 2
3
0 0 10 10 10 20
3 4 1 15 6 10
0 9 6 1 20 10
Sample Output 2
2
1
1
Sample Input 3
8
0 0 0 1 1 1
0 0 1 1 1 2
0 1 0 1 2 1
0 1 1 1 2 2
1 0 0 2 1 1
1 0 1 2 1 2
1 1 0 2 2 1
1 1 1 2 2 2
Sample Output 3
3
3
3
3
3
3
3
3
update @ 2024/3/10 08:53:47