#P3827. Clone Convex Hull Area
Clone Convex Hull Area
Clone Convex Hull Area
Little P has performed his famous "分!身!术!" (Clone Technique) on the plane. There are initially $n$ clones of Little P located on a 2D plane. The occupied region of a group of clones is defined as the smallest convex polygon (i.e., the convex hull) that covers them. Its area can be computed by the formula
$\displaystyle A=\frac{1}{2}\left|\sum_{i=0}^{k-1}\left(x_i y_{i+1}-x_{i+1}y_i\right)\right|$,
where the vertices $\left(x_0,y_0\right),\left(x_1,y_1\right),\ldots,\left(x_{k-1},y_{k-1}\right)$ are the points on the convex hull (listed in order) and $k$ is the number of vertices.
At every moment, some clones vanish; however, before the next moment, Little P revives them all, restoring their original positions. For each moment, you are given the list of clones that vanish. Your task is to compute the area of the convex hull of the remaining clones. If there are fewer than three points, the area is defined to be $0$.
inputFormat
The first line of input contains two integers $n$ and $q$, representing the total number of clones and the number of queries (moments), respectively.
The next $n$ lines each contain two numbers (which may be integers or decimals), representing the coordinates of each clone.
Each of the following $q$ lines describes a query. Each query begins with an integer $k$, the number of clones that vanish at that moment, followed by $k$ distinct integers indicating the indices (1-indexed) of the clones that disappear.
outputFormat
For each query, output the area of the convex hull of the remaining clones on a new line. If there are fewer than three remaining points, output 0
.
sample
5 3
0 0
1 0
1 1
0 1
0.5 0.5
1 5
2 2 3
0
1.0
0.25
1.0
</p>