In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
pairwise disjoint points in the plane are given (). There are 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:
In the first line of the standard input there is one integer () denoting the number of selected points. Each of the following lines contains two integers and () separated by a single space and denoting the coordinates of the point (for ). 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 .
For the input data:
5 0 0 1 2 0 2 1 0 1 1
the correct result is:
7.0
Task author: Jakub Radoszewski.