Adding and Removing Points#2949

Adding and Removing Points

1 second
256 megabytes
Easy

Not all N^2 \log N are equally useful...

Some Lecture

You have a multiset of points on a plane that you can modify at any time.

Your task is to handle three types of queries:

Input

The input begins with the number of queries (1 \leq N \leq 3000). This is followed by lines, each describing a query. Refer to the example for the specific format. The coordinates of the points are integers ranging from to . Points may overlap. When a request is made to remove a point, exactly one instance of that point must be removed (it is guaranteed that such a point exists in the multiset at the time of the request).

Output

After each operation on the set, output the current sum of the maximum distances. The absolute error must not exceed 10^{-6}.

Examples

Example 1

Loading
Loading