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

8166번 - Triangles 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 128 MB226433425.954%

문제

n pairwise disjoint points in the plane are given (n ≥ 3). There are \( \frac {n⋅(n-1)⋅(n-2)}{6} \) triangles whose vertices are some pairwise different points among them (including degenerate triangles, i.e. ones whose vertices are collinear).

We want to calculate the sum of areas of all the triangles with vertices in the given points.

Those parts of the plane that belong to many triangles are to be calculated multiple times. We assume that the area of degenerate triangles (i.e. those with collinear vertices) is zero.

Write a programme that:

  • reads from the standard input the coordinates of the points in the plane,
  • determines the sum of the areas of all the triangles with vertices in the given points,
  • prints out the result to the standard output.

입력

In the first line of the standard input there is one integer n (3 ≤ n ≤ 3,000) denoting the number of selected points. Each of the following lines contains two integers xi and yi (0 ≤ xi,yi ≤ 10,000) separated by a single space and denoting the coordinates of the ith point (for i=1,2,…,n). No pair (ordered) of coordinates appears more than once.

출력

In the first and only line of the standard output there should be one real number equal to the sum of the areas of all the triangles with vertices in the given points. The outcome should be printed out with exactly one digit after dot and should not differ from the correct value by more than 0.1.

제한

예제 입력 1

5
0 0
1 2
0 2
1 0
1 1

예제 출력 1

7.0

힌트

출처

Olympiad > Polish Olympiad in Informatics > POI 2007/2008 > Stage 3 4번

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

출처

대학교 대회

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

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