测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A11433. Symmetric Projections

编程题 普及/提高-

题目描述

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

说明/提示

Picture to the first sample test:

![](/uploads/acgo/image/40edf53999aa0550_54a9ce1fdc40.jpeg)

In the second sample, any line containing the origin is good.
上一题 去做题 下一题