#abc207d. D - Congruence Points
D - Congruence Points
Score : points
问题描述
给定两个集合 和 ,每个集合包含二维平面上的 个点。
确定是否可以按照任意顺序对集合 进行任意次数(包括零次)以下操作,使得 与 匹配:
- 选择一个实数 ,将 中的所有点绕原点顺时针旋转 度。
- 选择实数 和 ,将 中的所有点沿 轴方向移动 ,沿 轴方向移动 。这里的 和 可以为任何实数,无论是正数、负数或零。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given two sets and of points each on a two-dimensional plane.
Determine whether it is possible to do the following operations on any number of times (possibly zero) in any order so that matches .
- Choose a real number and rotate every point in degrees clockwise about the origin.
- Choose real numbers and and move every point in by in the -direction and by in the -direction. Here, and can be any real numbers, be it positive, negative, or zero.
Constraints
- if .
- if .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If we can match with , print Yes
; otherwise, print No
.
Sample Input 1
3
0 0
0 1
1 0
2 0
3 0
3 1
Sample Output 1
Yes
The figure below shows the given sets of points, where the points in and are painted red and green, respectively:
In this case, we can match with as follows:
- Rotate every point in degrees clockwise about the origin.
- Move every point in by in the -direction and by in the -direction.
Sample Input 2
3
1 0
1 1
3 0
-1 0
-1 1
-3 0
Sample Output 2
No
The figure below shows the given sets of points:
Although and are symmetric about the -axis, we cannot match with by rotations and translations as stated in Problem Statement.
Sample Input 3
4
0 0
2 9
10 -2
-6 -7
0 0
2 9
10 -2
-6 -7
Sample Output 3
Yes
Sample Input 4
6
10 5
-9 3
1 -5
-6 -5
6 9
-9 0
-7 -10
-10 -5
5 4
9 0
0 -10
-10 -2
Sample Output 4
Yes
update @ 2024/3/10 09:20:53