题库练习 Symmetric Projections
← 上一题 下一题 →

A11433 | Symmetric Projections

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

You are given a set of $n$ 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 $P$ on the plane such that the multiset is [centrally symmetric](https://en.wikipedia.org/wiki/Point_reflection) in respect of point $P$ .

输入格式

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

Each of the next $n$ lines contains two integers $x_{i}$ and $y_{i}$ ( $-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
C++ 编辑器
输入
输出