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

5973번 - Bovine Bridge Battle 다국어

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

문제

Each of Farmer John's N (4 <= N <= 1,000) cows is patiently waiting in the main pasture with cow i at point with integer coordinates (X_i, Y_i) (-1,000,000,000 <= X_i <= 1,000,000,000; -1,000,000,000 <= Y_i <= 1,000,000,000).

The cows wish to form into groups of four in order to play Bridge, their new favorite card game. Each group must satisfy an important constraint: four cows are allowed to team up if and only if there exists some point X somewhere in the plane (and not coincident with any of the four points of the potential group of four) such that rotating any of the group's cows 180 degrees about that point X gives the position of some other cow in the group.

Please help the cows determine the number of sets of four cows that can form a Bridge group.

By way of example, suppose eight cows are standing at eight points:

 |
 f*
 | a = (-3, 1) e = (-1, 1)
 b* | b = (-2, 2) f = ( 0, 3)
 a e | c = (-3, 0) g = ( 2, 0)
 * * | d = (-2, 0) h = ( 3, 0)
 c d | g h
---------*--*-----+-----*--*---------
 |

Then the three legal sets of four cows are {a, b, e, d} (they rotate around point (-2, 1)), {b, c, e, f} (around the point (-1.5, 1.5)), and {c, d, g, h} (around (0,0)).

The supplied locations of the cows given are all distinct, although they are supplied in no particular order. Furthermore, the answer will fit into a signed 32-bit integer.

입력

  • Line 1: A single integer: N
  • Lines 2..N+1: Line i+1 contains two space-separated integers: X_i and Y_i

출력

  • Line 1: A single integer that is the number of sets of 4 cows that form valid groups for bridge.

제한

예제 입력 1

8
-3 0
-2 0
-1 1
0 3
2 0
-3 1
3 0
-2 2

예제 출력 1

3

힌트

출처

Olympiad > USA Computing Olympiad > 2010-2011 Season > USACO March 2011 Contest > Silver 3번

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

출처

대학교 대회

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

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