P16506 [CodeChef] EAREA
普及
题目描述

You are given a convex polygon $P$ with vertices $P_0, P_1, \ldots, P_{n-1}$, each having integer coordinates. On each edge $P_{i} P_{(i+1) \% n}$ of the polygon, choose a point $R_i$ uniformly at random. What is the expected area of the convex hull of these $n$ chosen points $R_0, R_1, \ldots R_{n-1}$ ?

-----Note-----
- Consider the area of the convex hull as zero if it contains less than 3 vertices.
- All the points $R_i$ are chosen independently of each other.
- Your answer is considered correct if and only if its absolute or relative error doesn't exceed $10^{-6}$.

-----Input-----
- The first line contains $n$, the number of vertices in the convex polygon.
- The next $n$ lines contain the coordinates of the vertices of the polygon in anti-clockwise order.

-----Output-----
For each testcase, print the expected area of the convex hull of the $n$ randomly chosen points.

-----Constraints-----
- $3 \leq n \leq 10^5$
- The absolute values of all the coordinates $\leq 10^7$.
- All the points in the input are distinct.
- The described polygon $P$ is convex and the vertices of the polygon are given in anti-clockwise order. Also, no three vertices of the polygon are collinear.

-----Example Input-----
3
0 0
1 0
0 1

-----Example Output-----
0.1250000000

输入格式

见题面

输出格式

见题面

样例输入
['3', '0 0', '1 0', '0 1']
样例输出
['0.1250000000']