#P15786. [JAG 2025 Summer Camp #3] Copy, Reflect, and Paste
[JAG 2025 Summer Camp #3] Copy, Reflect, and Paste
题目描述
You are given a polygon with vertices, which is not necessarily convex. Initially, let . You can perform the following operation on any number of times:
- Choose a line segment of positive length lying on the boundary of , and let be the figure obtained by reflecting across the line containing this segment.
- If the interiors of and intersect, the process ends immediately.
- Otherwise, update to the union of and .
Determine whether the operation can be repeated indefinitely. In other words, determine whether it is possible to perform the operation at least times for every positive integer .
:::align{center}
:::
输入格式
The input consists of multiple test cases.
The first line contains an integer (), representing the number of test cases.
test cases follow. Each test case is given in the following format.
$$\begin{aligned} & N \\ & x_{1} \ y_{1} \\ & \vdots \\ & x_{N} \ y_{N} \end{aligned}$$For each test case, the first line contains an integer (), representing the number of vertices of the polygon.
Each of the following lines contains two integers and , representing that the -th vertex of polygon has coordinates . These points satisfy the following conditions:
- The vertices of polygon are given in counterclockwise order.
- is a simple polygon; in particular, no interior angle equals .
输出格式
Output lines. For each test case, output "Yes" if it is possible to perform the operation infinitely many times, and "No" otherwise.
2
4
0 0
1 0
1 1
0 1
6
11 6
19 10
9 10
5 18
5 3
15 -2
Yes
No