|
||||||||||
3D CameraTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 421 Accepted Submission(s): 14 Problem Description Long long ago, there was a world of triangles. A smart guy in that world invented a camera, whose viewfinder was a triangle. The camera's visual range could be represented by three RAYS. As the figure shows, the camera's visual range could be represented by three rays OA, OB, OC. Note that the visual range is INFINITE. Now, we have a camera with known visual range and a triangle DEF in the space. The inventor wants to know if the camera can see the triangle, in other words, if there is at least one point of the triangle strict in the visual range. Input The input consists of multiple test cases. The first line of input contains an integer T, which is the number of test cases. The first line of each test case contains 12 integers: Ox, Oy, Oz, Ax, Ay, Az, Bx, By, Bz, Cx, Cy, Cz. The second line contains 9 integers: Dx, Dy, Dz, Ex, Ey, Ez, Fx, Fy, Fz. All the integers in a line are separated by a whitespace. [Technical Specification] T is an integer, and T <= 1000. The input guaranteed that if you look from O, three points ABC are always arranged counterclockwise. All integers EXCEPT T is in the range of [-100,100]. We guarantee the camera and the triangle are not degenerate. Output For each test case, display a single line contains the result, "YES" for visible, "NO" for not visible. Sample Input
Sample Output
Source | ||||||||||
|