1380:Triangles

时间限制:2 S   /  内存限制:65536 KB
AC:49   /  Submit:116
问题描述

 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.)

输入描述

 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

输出描述

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

样例输入复制样例

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

样例输出

disjoint
intersect

 

来源
2017年第八届福建省大学生程序设计竞赛正式赛B

Copyright 2016 - 2024 XUJC ACM Team
闽ICP备2020022076号-1