Logo
(追記) (追記ここまで)

6744번 - Parallelogram Counting 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB153532122.340%

문제

There are n distinct points in the plane, given by their integer coordinates. Find the number of parallelograms whose vertices lie on these points. In other words, find the number of 4-element subsets of these points that can be written as {A, B, C, D} such that AB || CD, and BC || AD. No four points are in a straight line.

입력

The first line of the input file contains a single integer t (1 ≤ t ≤ 10), the number of test cases. It is followed by the input data for each test case.
The first line of each test case contains an integer n (1 ≤ n ≤ 1000). Each of the next n lines, contains 2 space-separated integers x and y (the coordinates of a point) with magnitude (absolute value) of no more than 1000000000.

출력

  • Output should contain t lines.
  • Line i contains an integer showing the number of the parallelograms as described above for test case i.

제한

예제 입력 1

2
6
0 0
2 0
4 0
1 1
3 1
5 1
7
-2 -1
8 9
5 7
1 1
4 8
2 0
9 8

예제 출력 1

5
6

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > Iran Internet Programming Contest > IIPC 2005 B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /