QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 32 MB Total points: 100

#13176. Triangles

Statistics

$n$ pairwise disjoint points in the plane are given ($n ≥ 3$). There are $\frac {n\cdot (n-1)\cdot (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.

Task

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.

Input

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 $x_i$ and $y_i$ ($0 ≤ x_i,y_i ≤ 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.

Output

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$.

Example

Input

5
0 0
1 2
0 2
1 0
1 1

Output

7.0
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.