Good Triangle
시간 제한2초메모리 제한1024 MB
주어진 점들 중 세 점에서 맨해튼 거리가 모두 같은 점이 존재하는 삼중항의 개수를 센다.
문제
You are given distinct points on the two dimensional plane.
We define the distance between two points and as .
Let's say that three distinct points form a good triangle if there exists a point such that . Note that 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 .
The -th line of the next lines contains two space-separated integers , meaning that the coordinate of the -th point is .
출력
Print one integer, the number of good triangles that can be formed by the given points.
제한
- ()
- if ()
- All values in the input are integers.