2366.Number of Parallelograms

Time Limit: 1s Memory Limit: 256MB

You are given n points on a plane. All the points are distinct and no three of them lie on the same line. Find the number of parallelograms with the vertices at the given points.

Input Format(From the terminal/stdin)

The first line of the input contains integer n (1 \le n \le 2000) - the number of points.

Each of the next n lines contains two integers (xi,yi) (0 \le xi,yi \le 109) - the coordinates of the i-th point.

Output Format(To the terminal/stdout)

Print the only integer c - the number of parallelograms with the vertices at the given points.

Sample Input

Copy
4
0 1
1 0
1 1
2 0
 \n
 · \n
 · \n
 · \n
 · \n

Sample Output

Copy
1
 \n

Submit

请先 登录

© 2025 FAQs