创建于 2026/07/17 · 更新于 2026/07/17
You are given pairwise disjoint convex polygons on the plane.
Determine whether there exists a point and pairwise distinct rays starting from such that these rays divide the plane into closed angular regions, and each polygon can be assigned to exactly one of these regions, with no two polygons assigned to the same region.
The regions include their boundary rays. Therefore, it is allowed that a boundary ray passes through vertices or edges of polygons. It is also allowed that vertices of different polygons lie on the same boundary ray.
You only need to decide whether such a point and such rays exist.It is guaranteed for , that the answer does not change if the input coordinates modified by .
The first line contains an integer , the number of test cases.
For each test case, the first line contains an integer , the number of convex polygons.
For each polygon , the first line contains an integer , the number of vertices of the -th polygon.
Each of the next lines contains two integers and , the coordinates of the -th vertex of the -th polygon.
The vertices of each polygon are given in counterclockwise order. Each polygon is convex and has positive area. The given polygons are pairwise disjoint.
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, output one line.
Output YES if there exists such a point and such rays. Otherwise, output NO.
3
2
4
-4 -1
-2 -1
-2 1
-4 1
4
2 -1
4 -1
4 1
2 1
4
4
-6 3
-2 4
-3 15
-7 14
4
-1 -3
10 -2
9 3
-2 2
4
2 -11
3 -11
4 -7
1 -8
4
4 -10
15 -9
14 -8
5 -8
4
4
-8 -8
-6 -8
-6 -6
-8 -6
4
6 -8
8 -8
8 -6
6 -6
4
6 6
8 6
8 8
6 8
4
-8 6
-6 6
-6 8
-8 8
YES
NO
YES