#fish9. 鱼

P5286 [HNOI2019] Fish

Problem Description

Note: Source from Luogu.

The data for this problem says there are no issues

Problem Description

In a plane coordinate system, given nn distinct integer points (i.e., points with both x and y coordinates as integers), we define an ordered sextuple (A,B,C,D,E,F)(A,B,C,D,E,F) formed by selecting six distinct points from these nn points as a "fish" if and only if:

  • AB=ACAB = AC, BD=CDBD = CD, DE=DFDE = DF (the body must be symmetric),
  • BAD\angle BAD, BDA\angle BDA, CAD\angle CAD, and CDA\angle CDA are all acute angles (the head and tail cannot be concave),
  • ADE\angle ADE and ADF\angle ADF are greater than 9090^\circ (i.e., obtuse or straight angles, ensuring the tail does not appear awkwardly raised).

The following image is an example of a legal fish:

Fish with identical points but different sequences are considered distinct, meaning (A,B,C,D,E,F)(A,B,C,D,E,F) and (A,C,B,D,E,F)(A,C,B,D,E,F) are treated as two different fish (after all, fish have a back and a belly). Similarly, (A,B,C,D,E,F)(A,B,C,D,E,F) and (A,B,C,D,F,E)(A,B,C,D,F,E) can also be regarded as two different fish (assuming fish tails can be tied in knots).

How many fish can be formed from the given nn points? Specifically, the data ensures that the nn points are all distinct.

Input Format

The first line contains a positive integer nn, representing the number of points in the plane.

The next nn lines each contain two integers x,yx, y, representing the horizontal and vertical coordinates of the points.

## Output Format

Output one non-negative integer per line, representing the number of fish.

Input and Output Example #1

Input #1

eight
-2 0
-1 0
0 1
0 -1
1 0
2 0
3 1
3 -1

Output #1

sixteen

Instructions/Notes

For 62.5% of the data, it is guaranteed that: n=10n=10; For the remaining data, ensure: n=8n=8;