- محدودیت زمان: ۴ ثانیه
- محدودیت حافظه: ۳۲ مگابایت
In a two-dimensional coordinate plane, there are N distinct points given as input, specified by their coordinates $(x_i, y_i)$ for $i = 1, 2, ..., N$. Your task is to develop a program that computes the number of unique Orthogonal (right) triangles that can be formed by selecting any three of the provided points.
An Orthogonal triangle is a triangle in which one of the angles measures exactly 90 degrees.
Input
The first line of input contains an integer N, the number of points.
Each of the following N lines contains the coordinates of one point, two integers $(x_i, y_i)$ separated by a space. No two points will be located at the same coordinates.
Output
Output the number of Orthogonal triangles.
Constrints
- $3 \leq N \leq 1500 $
- $-10^9 \leq x_i,y_i \leq 10^9 $
Sample Test Data
input 1
5
1 1
1 0
0 0
-1 0
-1 1
input 2
7
ارسال پاسخ برای این سؤال