#P5286. [HNOI2019] 鱼
[HNOI2019] 鱼
Description
On the plane coordinate system, you are given distinct lattice points (that is, points whose - and -coordinates are both integers). We call an ordered 6-tuple formed by choosing 6 different points among these points a “fish” if and only if: , , and (the body must be symmetric), and both and are acute angles (the head and the tail obviously cannot be concave), and are greater than (that is, obtuse angles or straight angles, so that the tail will not stick up awkwardly).
The figure below shows an example of a valid fish:

Fish that consist of the same set of points but in different orders are considered different fish. For example, and are considered two different fish (after all, a fish has a back and a belly). Similarly, and are also considered two different fish (suppose the fish tail can be tied into a knot).
Given the points, find how many fish can be formed. In particular, the input guarantees that all points are pairwise distinct.
Input Format
The first line contains a positive integer , representing the number of points on the plane.
The next lines each contain two integers , representing the coordinates of a point.
Output Format
Output one line with a non-negative integer, representing the number of fish.
8
-2 0
-1 0
0 1
0 -1
1 0
2 0
3 1
3 -1
16
Hint
For the first 20% of the data, it is guaranteed that .
For the first 40% of the data, it is guaranteed that , .
For another 20% of the data, it is guaranteed that .
For all data, it is guaranteed that , , and the points are pairwise distinct.
Translated by ChatGPT 5
京公网安备 11011102002149号