P6341 [COCI 2007/2008 #2] PRAVOKUTNI
Description
Given $n$ points on a plane, compute how many distinct right triangles have all their vertices among the given points.
Two right triangles are considered different if and only if they have at least one different vertex.
Input Format
The first line contains an integer $n$, representing the number of points.
The next $n$ lines each contain two integers, representing the coordinates of a point.
Output Format
Output the number of right triangles.
Explanation/Hint
#### Constraints
For $100\%$ of the testdata, it is guaranteed that $3 \le n \le 1500$, the coordinate values are between $-10^9$ and $10^9$, and no two points have the same coordinates.
#### Notes
**This problem is translated from [COCI2007-2008](https://hsin.hr/coci/archive/2007_2008/) [CONTEST #2](https://hsin.hr/coci/archive/2007_2008/contest2_tasks.pdf) *T6 PRAVOKUTNI***。
Translated by ChatGPT 5