提示: 欢迎访问OurACM平台。
Problem 2273 Triangles

Accept: 115    Submit: 369
Time Limit: 1000 mSec    Memory Limit : 262144 KB

Problem Description

This is a simple problem. Given two triangles A and B, you should determine they are intersect, contain or disjoint. (Public edge or point are treated as intersect.)

Input

First line contains an integer T (1 ≤ T ≤ 10), represents there are T test cases.

For each test case: X1 Y1 X2 Y2 X3 Y3 X4 Y4 X5 Y5 X6 Y6. All the coordinate are integer. (X1,Y1) , (X2,Y2), (X3,Y3) forms triangles A ; (X4,Y4) , (X5,Y5), (X6,Y6) forms triangles B.

-10000<=All the coordinate <=10000

Output

For each test case, output “intersect”, “contain” or “disjoint”.

Sample Input

2 0 0 0 1 1 0 10 10 9 9 9 10 0 0 1 1 1 0 0 0 1 1 0 1

Sample Output

disjoint intersect

Source

第八届福建省大学生程序设计竞赛-重现赛(感谢承办方厦门理工学院)

Submit  Back  Status  Discuss