Codeforces Round 445 (Div. 1, based on Technocup 2018 Elimination Round 3)
D
Symmetric Projections
Codeforces
未评级
原题
← CE →
翻译中…

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*$.

翻译中…

Input

翻译中…

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.

翻译中…

Output

翻译中…

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

翻译中…

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

翻译中…

Note

翻译中…

Picture to the first sample test:

翻译中…

image

翻译中…

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

翻译中…

样例

Input #1
3
1 2
2 1
3 3
Output #1
3
InputCopy OutputCopy
Input #2
2
4 3
1 2
Output #2
-1
InputCopy OutputCopy
题目信息
题号
889D
时间限制
2 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。