Magic
시간 제한3초메모리 제한1024 MB
매 순간 일부 점이 사라지고 사라진 점의 번호가 이전 답에 따라 정해질 때, 남은 점들의 볼록 껍질 넓이의 두 배를 구한다.
문제
There are clones of Little P on the plane. Define the area occupied by a group of instances as the smallest convex polygon that covers this group of instances. Little P has limited abilities, and some clones will disappear every moment. But before the next moment, Little P will use the magic technique to make these disappeared clones reappear in their original positions.
Given queries, after each moment when the clone disappears, what is the area occupied by the remaining clone?
입력
The first line of input contains two positive integers , describing the number of clones at the beginning and the total number of quries.
The next line, the line has two integers , describing the position of the th clone.
In the next lines, the first integer in each line indicates that clones have disappeared at this moment. Next there are non-negative integers , which are used to generate the numbers of the disappeared clones.
Generated as follows:
Assume twice the area occupied by the avatar at the previous moment is . Then the numbers of the clones that disappeared at this moment are: .
In particular, at the first moment, we believe that in the previous moment, that is: the numbers of the clones that disappeared at the first moment are: .
출력
Output the lines sequentially in the order of the given time, each line is an integer, representing twice the area occupied by the remaining clones at that time.
제한
- ;
- No two clones have exactly the same coordinates;
- ;
- The sum of at all times does not exceed ;
- ;
- Initially, all clones occupy an area greater than ;
- The set of vertices defining the region occupied by all clones is , . At any moment, there are at least two undisappeared clones in .