Triple Deluxe
There is nothing that Parsa loves more than point-based geometry problems so he has one for you.
Parsa has a set of n 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 n, the number of points Parsa has (3≤n≤200)
n lines follow, each with xiyi, the coordinates of a point Parsa has −1e5≤xi,yi≤1e5.
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
5
3 1
5 5
2 -4
3 -1
2 -3
1.3888888888888888
6
7 2
-5 4
-1 -10
-6 -3
-8 9
-7 6
35.5
3
6 7
-16 -11
20 0
203.0
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.