Time Limit: 1s
Memory Limit: 128MB
Given two triangles in 3D space, you are asked to tell if they are hooked together. They are called hooked together if you can’t separate them without breaking any of them.
The first line contains the number of test cases. Each case have two lines: A1x A1y A1z B1x B1y B1z C1x C1y C1z A2x A2y A2z B2x B2y B2z C2x C2y C2z Indicating the coordinates of each triangle(A1B1C1 and A2B2C2). All numbers in the input file are integers in the range [0, 500]. The sides of the two triangles have no intersections.
Output “YES” if they are hooked together or “NO” otherwise.
2 0 0 0 1 0 0 0 1 0 0 0 2 1 0 2 0 1 2 1 1 1 4 1 1 1 4 1 0 0 0 0 0 2 2 2 1
NO YES