Problem4182--立方体判断(Cube judgment)

4182: 立方体判断(Cube judgment)

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 19  Solved: 5
[Submit] [Status] [Web Board] [Creator:]

Description

25points

English:

Given eight points in three-dimensional space, determine whether they are the eight vertices of a cube.

note: In geometry, a cube is a regular hexahedron composed of 6 squares


Chinese:
给出三维空间的八个点,判断它们是否是一个立方体的八个顶点。
PS: 在几何学中,立方体是由6个正方形组成的正六面体

Input

There are 8 lines in total, each line is three integers x,y,z separated by spaces (-105 <= x,y,z <= 105). The title ensures that the eight points of a set of data do not overlap with each other.



Note that each set of data is independent of each other and there is no connection.



一共8行,每行为以空格分隔的三个整数x,y,z(-105 <= x,y,z <= 105)。题目保证一组数据的八个点互相不重合。 

注意每组数据之间相互独立,没有联系。

Output

If these eight points can form a cube, output YES, otherwise output NO.

如果这八个点可以构成一个立方体,输出YES,否则输出NO。

Sample Input Copy

0 0 0
4 3 0
1 7 0
-3 4 0
0 0 5
4 3 5
1 7 5
-3 4 5

Sample Output Copy

YES

Source/Category