Adding and Removing Points
Not all N^2 log N are equally useful...
Some Lecture
You have a multiset A of points on a plane that you can modify at any time.
Your task is to handle three types of queries:
Add a point to the multiset A.
Remove a point from the multiset A.
Compute the
distance(p, q).
Input
The input begins with the number of queries N (1 ≤ N ≤ 3000). This is followed by N lines, each describing a query. Refer to the example for the specific format. The coordinates of the points are integers ranging from 0 to 3000. 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}.