ساعت
۹۰۱۲۳۴۵۶۷۸۹۰۹۰۱۲۳۴۵۶۷۸۹۰
ساعت
دقیقه
۹۰۱۲۳۴۵۶۷۸۹۰۹۰۱۲۳۴۵۶۷۸۹۰
دقیقه
ثانیه
۹۰۱۲۳۴۵۶۷۸۹۰۹۰۱۲۳۴۵۶۷۸۹۰
ثانیه
  • محدودیت زمان: ۴ ثانیه
  • محدودیت حافظه: ۳۲ مگابایت

In a two-dimensional coordinate plane, there are N distinct points given as input, specified by their coordinates (xi,yi)(x_i, y_i) for i=1,2,...,Ni = 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 (xi,yi)(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

  • 3N15003 \leq N \leq 1500
  • 109xi,yi109-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
Plain text

input 2

7
Plain text

ارسال پاسخ برای این سؤال
فایلی انتخاب نشده است.