Triple Deluxe
View as PDFThere is nothing that Parsa loves more than point-based geometry problems so he has one for you.
Parsa has a set of distinct points. He chooses 3 points at uniformly at random. If they are collinear, he chooses again. Otherwise, he finds the area of the triangle made by the three points.
What is the expected area of the triangle?
Input
The first line has , the number of points Parsa has
lines follow, each with
, the coordinates of a point Parsa has
.
All points are distinct and guaranteed to not be all collinear.
Output
Write the expected area of a triangle that Parsa chooses. Answers with a relative or absolute error less and 1e-6 will be accepted.
Sample Input
Input 1
3 1
5 5
2 -4
3 -1
2 -3Output 1
Input 2
7 2
-5 4
-1 -10
-6 -3
-8 9
-7 6Output 2
Input 3
6 7
-16 -11
20 0Output 3
Comments