CF886F.Symmetric Projections

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given a set of nn points on the plane. A line containing the origin is called good, if projection of the given set to this line forms a symmetric multiset of points. Find the total number of good lines.

Multiset is a set where equal elements are allowed.

Multiset is called symmetric, if there is a point PP on the plane such that the multiset is centrally symmetric in respect of point PP .

输入格式

The first line contains a single integer nn ( 1<=n<=20001<=n<=2000 ) — the number of points in the set.

Each of the next nn lines contains two integers xix_{i} and yiy_{i} ( 106<=xi,yi<=106-10^{6}<=x_{i},y_{i}<=10^{6} ) — the coordinates of the points. It is guaranteed that no two points coincide.

输出格式

If there are infinitely many good lines, print -1.

Otherwise, print single integer — the number of good lines.

输入输出样例

  • 输入#1

    3
    1 2
    2 1
    3 3
    

    输出#1

    3
    
  • 输入#2

    2
    4 3
    1 2
    

    输出#2

    -1
    

说明/提示

Picture to the first sample test:

In the second sample, any line containing the origin is good.

首页