시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 146 31 27 30.000%

문제

2차원 평면 위에 점 N개가 있다.

세 점을 골랐을 때, 직각 삼각형을 이루는 것의 쌍의 수를 구하는 프로그램을 작성하시오. 직각 삼각형이란 한 각이 90도인 삼각형이다.

입력

첫째 줄에 점의 수 N이 주어진다. (3 ≤ N ≤ 1500)

다음 N개 줄에는 점의 x좌표와 y좌표가 공백으로 구분되어진 상태로 주어진다. 좌표는 -109와 109 사이이다. 두 점이 같은 좌표를 갖는 경우는 없다.

출력

첫째 줄에 직각 삼각형의 개수를 출력한다.

예제 입력 1

3
4 2
2 1
1 3

예제 출력 1

1
W3sicHJvYmxlbV9pZCI6IjMwMDgiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM5YzFcdWFjMDEgXHVjMGJjXHVhYzAxXHVkNjE1XHVjNzU4IFx1YWMxY1x1YzIxOCIsImRlc2NyaXB0aW9uIjoiPHA+Mlx1Y2MyOFx1YzZkMCBcdWQzYzlcdWJhNzQgXHVjNzA0XHVjNWQwIFx1YzgxMCBOXHVhYzFjXHVhYzAwIFx1Yzc4OFx1YjJlNC48XC9wPlxyXG5cclxuPHA+XHVjMTM4IFx1YzgxMFx1Yzc0NCBcdWFjZThcdWI3OTBcdWM3NDQgXHViNTRjLCBcdWM5YzFcdWFjMDEgXHVjMGJjXHVhYzAxXHVkNjE1XHVjNzQ0IFx1Yzc3NFx1YjhlOFx1YjI5NCBcdWFjODNcdWM3NTggXHVjMzBkXHVjNzU4IFx1YzIxOFx1Yjk3YyBcdWFkNmNcdWQ1NThcdWIyOTQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQ0IFx1Yzc5MVx1YzEzMVx1ZDU1OFx1YzJkY1x1YzYyNC4gXHVjOWMxXHVhYzAxIFx1YzBiY1x1YWMwMVx1ZDYxNVx1Yzc3NFx1Yjc4MCBcdWQ1NWMgXHVhYzAxXHVjNzc0IDkwXHViM2M0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