| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 1024 MB | 68 | 35 | 33 | 50.769% |
You are given $n$ distinct points on the two dimensional plane.
We define the distance between two points $P=(x_1, y_1)$ and $Q=(x_2, y_2)$ as $d(P, Q)=|x_1-x_2|+|y_1-y_2|$.
Let's say that three distinct points $U, V, W$ form a good triangle if there exists a point $T$ such that $d(U, T)=d(V, T)=d(W, T)$. Note that $T$ does not have to be a lattice point.
Find the number of good triangles that can be formed by the given points.
The first line of input contains $N$.
The $i$-th line of the next $N$ lines contains two space-separated integers $x_i, y_i,ドル meaning that the coordinate of the $i$-th point is $(x_i, y_i)$.
Print one integer, the number of good triangles that can be formed by the given points.
5 1 -1 1 5 5 7 1 3 4 2
9
10 -2 -1 -2 2 -1 -2 -1 -1 -1 1 0 1 1 -1 1 2 2 -1 2 1
108