Polar intersecting line segments
Time Limit: 1000 MS Memory Limit: 65536 K
Description
In this problem, you are asked to determine if a set of line segments intersect.
Input
The first line of input is a number c ≤ 20, the number of test cases. The first line of each test case is a number k ≤ 50000, the number of line segments. The following k lines each consist of two numbers to eight decimal places θ1, θ2 with 0 < θ1 < 2π and 0 < θ2 < 2π describing the line segment from (cos θ1, sin θ1) to (cos θ2, sin θ2). For each test case, all inputs points are distinct.
Output
For each test case, you should output a single line containing “intersect” if any two of the k lines intersect and “do not intersect” otherwise. The endpoints of a line are considered t