#P6341. [COCI 2007/2008 #2] PRAVOKUTNI
[COCI 2007/2008 #2] PRAVOKUTNI
Problem Description
Given 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 , representing the number of points.
The next lines each contain two integers, representing the coordinates of a point.
Output Format
Output the number of right triangles.
3
4 2
2 1
1 3
1
4
5 0
2 6
8 6
5 7
0
5
-1 1
-1 0
0 0
1 0
1 1
7
Hint
Constraints
For of the testdata, it is guaranteed that , the coordinate values are between and , and no two points have the same coordinates.
Notes
This problem is translated from COCI2007-2008 CONTEST #2 T6 PRAVOKUTNI。
Translated by ChatGPT 5