Rhombuses
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
On the coordinate plane, you are given N distinct points. Petro has a particular interest in rhombuses, which are defined as convex quadrilaterals with non-zero area, where all sides are of equal length.
Your task is to write a program that calculates the number of distinct ways to select four points from these given points to form a rhombus. Two selections are considered different if they differ by at least one point.
Input
The first line contains an integer N, representing the number of points (1 ≤ N ≤ 300). Each of the next N lines contains two integers, specifying the coordinates x_i and y_i of each point (-10^8 ≤ x_i, y_i ≤ 10^8).
Output
Output a single integer, which is the number of ways to select four points that form a rhombus.
Examples
Input #1
Answer #1
Submissions 86
Acceptance rate 33%