Magic
Time limit3sMemory limit1024 MB
Each round deletes some points (indices decoded from the previous answer). Print twice the convex hull area of the remaining points each round.
- Level
Hard9 of 10
- Topics
- Geometry, Divide and conquer, Sorting
- Solved
- No attempts yet
Statement
There are clones of Little P on the plane. The area occupied by a group of clones is the area of the smallest convex polygon that covers the group. Little P has limited abilities, so some clones disappear at each moment. Before the next moment, Little P uses a magic technique to make the disappeared clones reappear at their original positions.
Given queries, find the area occupied by the remaining clones after each moment when clones disappear.
Input
The first line contains two positive integers and , the number of clones at the beginning and the total number of queries.
The next lines contain two integers and each, the position of the -th clone.
Each of the next lines starts with an integer , meaning clones disappear at this moment. It is followed by non-negative integers , which are used to generate the numbers of the disappeared clones.
Let be twice the area occupied by the remaining clones at the previous moment. The numbers of the clones that disappear at this moment are . At the first moment, take , so .
Output
For each of the moments, in the given order, print one integer on its own line: twice the area occupied by the clones that remain at that moment.
Constraints
- No two clones have the same coordinates.
- The sum of over all moments does not exceed .
- Initially, all clones occupy an area greater than .
- The set of vertices that define the region occupied by all clones is , with . At any moment, at least two clones in have not disappeared.