Limits 1s, 512 MB

There are n points in the plane, the ith of which is labeled Pi and has coordinates (xi,yi).

We know that the formula of Euclidean distance ( https://en.wikipedia.org/wiki/Euclidean_distance ) of two points which is denoted fun(P,Q) = ((p1 - q1)^2 + (p2 - q2)^2)^(1/2)

Now find how many ordered quadruples of pairwise-distinct indices (p,q,r,s) are there such that fun(p,q)+fun(r,s) is equal to fun(q,r) +fun(p,s) ?

Double precision should be 1e-6 (EPS = 1e-6)

Input

The first line of input contains a single integer (4<=n<=250).

The next n lines of input each contain two space-separated integers (0<=xi,yi<=16).

Output

Print a single integer: the number of ordered quadruples which is satisfied the condition.

Sample

InputOutput
4
3 0
0 4
7 3
4 7
8

Explanation:

The eight quadruples are

(0,1,3,2),

(0,2,3,1),

(1,0,2,3),

(1,3,2,0),

(2,0,1,3),

(2,3,1,0) ,

(3,1,0,2) ,

(3,2,0,1)

Submit

Login to submit.

Statistics

55% Solution Ratio
Chakraborty14Earliest, Jan '21
steinumFastest, 0.0s
steinumLightest, 5.5 kB
nasibsuShortest, 1086B
Toph uses cookies. By continuing you agree to our Cookie Policy.