304645: CF886F. Symmetric Projections
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Symmetric Projections
题意翻译
## 题目描述 >给出$n$个点$(x,y)$,对于一条过原点的直线,如果$n$个点在它上面的投影是中心对称的`即存在一个点使得投影旋转180度后能和旋转前重合,这个点不一定是原点`,那么称这是一条好的直线. >给出所有的点,问有多少条好的直线,如果有无限条好的直线,输出`-1`. ## 输入格式 >第一行,一个正整数$n$ >接下来$n$行,每行包含两个整数$x_i,y_i$ ## 输出格式 >如果有无限条符合条件的,输出`-1`,否则输出一个整数表示数量题目描述
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