CF886F.Symmetric Projections
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 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 xi and yi ( −106<=xi,yi<=106 ) — 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.