22009_Centerofsymmetry

2022-5-16 18:21| 发布者: Hocassian| 查看: 20| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-8950636528300-Problem List-采集的数据-后羿采集器.html

Pro.ID

22009

Title

Center of symmetry

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22009

AC

1

Submit

1

Ratio

100.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    Given is a set of n points with integer coordinates. Your task is to decide whether the set has a center of symmetry.

    A set of points S has the center of symmetry if there exists a point s (not necessarily in S) such that for every point p in S there exists a point q in S such that p-s = s-q.

    输入

    The first line of input contains a number c giving the number of cases that follow. The first line of data for a single case contains number 1 ≤ n ≤ 10000. The subsequent n lines contain two integer numbers each which are the x and y coordinates of a point. Every point is unique and we have that -10000000 ≤ x, y ≤ 10000000.

    输出

    Description

    Given is a set of n points with integer coordinates. Your task is to decide whether the set has a center of symmetry.

    A set of points S has the center of symmetry if there exists a point s (not necessarily in S) such that for every point p in S there exists a point q in S such that p-s = s-q.

    Input

    The first line of input contains a number c giving the number of cases that follow. The first line of data for a single case contains number 1 ≤ n ≤ 10000. The subsequent n lines contain two integer numbers each which are the x and y coordinates of a point. Every point is unique and we have that -10000000 ≤ x, y ≤ 10000000.

    Output

    For each set of input data print yes if the set of points has a center of symmetry and no otherwise.

    Sample Input

    1
    8
    1 10
    3 6
    6 8
    6 2
    3 -4
    1 0
    -2 -2
    -2 4

    Sample Output

    yes

    Source

    样例输入

    1
    8
    1 10
    3 6
    6 8
    6 2
    3 -4
    1 0
    -2 -2
    -2 4

    样例输出

    yes

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部