CF1299B.Aerodynamic
普及+/提高
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating P by vector (x,y). The picture below depicts an example of the translation:

Define T as a set of points which is the union of all P(x,y) such that the origin (0,0) lies in P(x,y) (both strictly inside and on the boundary). There is also an equivalent definition: a point (x,y) lies in T only if there are two points A,B in P such that AB=(x,y). One can prove T is a polygon too. For example, if P is a regular triangle then T is a regular hexagon. At the picture below P is drawn in black and some P(x,y) which contain the origin are drawn in colored:

The spaceship has the best aerodynamic performance if P and T are similar. Your task is to check whether the polygons P and T are similar.
Guy-Manuel 和 Thomas 将要建造一艘多边形宇宙飞船。
给定一个严格凸的(即任意三点不共线)多边形 P,其顶点坐标已知。定义 P(x,y) 为将 P 沿向量 (x,y) 平移后所得的多边形。下图展示了一个平移示例:

定义集合 T 为所有满足原点 (0,0) 位于 P(x,y) 内(包括严格内部及边界上)的 P(x,y) 的并集。另一种等价定义为:点 (x,y) 属于 T 当且仅当存在两点 A,B∈P,使得 AB=(x,y)。可以证明 T 本身也是一个多边形。例如,若 P 是一个正三角形,则 T 是一个正六边形。下图中,黑色绘制的是 P,若干个包含原点的 P(x,y) 以不同颜色绘制:

当 P 与 T 相似时,该宇宙飞船具有最佳空气动力学性能。你的任务是判断多边形 P 与 T 是否相似。
输入格式
The first line of input will contain a single integer n (3≤n≤105) — the number of points.
The i-th of the next n lines contains two integers xi,yi (∣xi∣,∣yi∣≤109), denoting the coordinates of the i-th vertex.
It is guaranteed that these points are listed in counterclockwise order and these points form a strictly convex polygon.
输入的第一行包含一个整数 n(3≤n≤105)—— 表示点的数量。
接下来的 n 行中,第 i 行包含两个整数 xi,yi(∣xi∣,∣yi∣≤109),表示第 i 个顶点的坐标。
保证这些点按逆时针顺序给出,且构成一个严格凸多边形。
输出格式
Output "YES" in a separate line, if P and T are similar. Otherwise, output "NO" in a separate line. You can print each letter in any case (upper or lower).
如果 P 和 T 相似,则在单独一行输出 "YES";否则,在单独一行输出 "NO"。每个字母可使用大写或小写形式输出。
输入输出样例
输入#1
4 1 0 4 1 3 4 0 3
输出#1
YES
输入#2
3 100 86 50 0 150 0
输出#2
nO
输入#3
8 0 0 1 0 2 1 3 3 4 6 3 6 2 5 1 3
输出#3
YES
说明/提示
The following image shows the first sample: both P and T are squares. The second sample was shown in the statements.

下图展示了第一个样例:P 和 T 均为正方形。第二个样例已在题目描述中给出。

输入解题思路,AI测评打分。不知道怎么写?