-->
当前位置:首页 > 题库

PROGRAMMING:Cut in the wind

Luz5年前 (2021-05-10)题库405
If your knife is fast enough, this straight knife can cut two polygon fragments. On the other hand, if someone comes to boast with two pieces of debris and says that they cut it off with a knife in the wind, can you check whether it's true?
Note that the two polygons placed in front of you may not be placed end to end. They may be translated, rotated (90 degrees, 180 degrees, or 270 degrees counter clockwise), or flipped (mirror).
It is assumed that the four sides of the original flag are parallel to the coordinate axis.
###Input format:
Enter the first line to give a positive integer $$n $$($$Le 20 $$), followed by $$n $$for polygons. Each polygon is given in the following format:
$$k\quad x_ 1\quad y_ 1\cdots x_ k\quad y_ k$$
Where $$k $$($$2 < K / Le 10 $$) is the number of polygon vertices$$( x_ i, y_ i)$$($$0 \le x_ i, y_ I / le10 ^ 8 $$) is the vertex coordinates, given in clockwise or counterclockwise order.
Note: the title ensures that there are no redundant vertices. That is to say, the vertices of each polygon are not repeated, and any three adjacent vertices are not collinear.
###Output format:
For each pair of polygons, output 'yes' or' no '.
###Input example:
```in
eight
3 0 0 1 0 1 1
3 0 0 1 1 0 1
3 0 0 1 0 1 1
3 0 0 1 1 0 2
4 0 4 1 4 1 0 0 0
4 4 0 4 1 0 1 0 0
3 0 0 1 1 0 1
4 2 3 1 4 1 7 2 7
5 10 10 10 12 12 12 14 11 14 10
3 28 35 29 35 29 37
3 7 9 8 11 8 9
5 87 26 92 26 92 23 90 22 87 22
5 0 0 2 0 1 1 1 2 0 2
4 0 0 1 1 2 1 2 0
4 0 0 0 1 1 1 2 0
4 0 0 0 1 1 1 2 0
```
###Output example:
```out
YES
NO
YES
YES
YES
YES
NO
YES
```






answer:If there is no answer, please comment