Segment

Time Limit: 2000ms
Memory Limit: 65535KB
This problem will be judged on HDU. Original ID: 3492
64-bit integer IO format: %I64d      Java class name: Main

Description

In the annual Gaozhong Shuxue Liansai in the kingdom of Henryy, difficult geometry problems often appear. Let’s have a look at a problem:
N (1<=N<=300) segments are on a two dimension Cartesian plane. Your task is to check out whether there is a line that the intersection of the projections of all N segments is non-empty.

Input

The first line contains an integer T, indicating the number of the test cases.
For each test case, the first line contains an integer N, the number of the segments.
Then N lines follows, each has four integers (x1, y1), (x2, y2), indicating the two endpoints of this segment.

Output

For each test case, output a line: if such a line exists, print “Yes”; otherwise, print “No”.

Sample Input

2
2
0 0 1 1
2 1 4 -1
4
6 5 0 1
1 9 0 6
9 7 0 10
7 10 8 7

Sample Output

Yes
No

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .