P9423 [Lanqiao Cup 2023 National B] Number Triangle.

Description

Xiaoming places $n$ points on a 2D coordinate plane. He wants to choose a subset of three points that can form a triangle. However, there are too many such choices, so he decides to only count those that can form an isosceles triangle. Please help him compute how many different ways to choose three points can form an isosceles triangle.

Input Format

The input has $n + 1$ lines. The first line contains a positive integer $n$. The next $n$ lines each contain two integers $x_i, y_i$, representing the coordinates of the $i$-th point.

Output Format

Output one line containing one integer.

Explanation/Hint

### Sample Explanation There are $5$ ways in total: $\{2,3,4\}$, $\{3,4,5\}$, $\{4,5,2\}$, $\{5,2,3\}$, $\{1,3,5\}$. ### Test Case Scale and Assumptions - For $20\%$ of the testdata, it is guaranteed that $n \le 200$. - For $100\%$ of the testdata, it is guaranteed that $n \le 2000$, $0 \le x_i, y_i \le 10^9$. The 14th Lanqiao Cup Software Competition Finals, C/C++ University Group B, Problem E. Translated by ChatGPT 5