CF1028F.Make Symmetrical

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Consider a set of points AA , initially it is empty. There are three types of queries:

  1. Insert a point (xi,yi)(x_i, y_i) to AA . It is guaranteed that this point does not belong to AA at this moment.
  2. Remove a point (xi,yi)(x_i, y_i) from AA . It is guaranteed that this point belongs to AA at this moment.
  3. Given a point (xi,yi)(x_i, y_i) , calculate the minimum number of points required to add to AA to make AA symmetrical with respect to the line containing points (0,0)(0, 0) and (xi,yi)(x_i, y_i) . Note that these points are not actually added to AA , i.e. these queries are independent from each other.

输入格式

The first line contains a single integer qq ( 1q21051 \le q \le 2 \cdot 10^5 ) — the number of queries.

Each of the following qq lines describes a query and contains three integers tit_i , xix_i and yiy_i ( $ t_i \in {1, 2, 3}$ , 1xi,yi1129041 \le x_i, y_i \le 112\,904 ) — the type of the query and the coordinates of the point. Type 11 is addition of the point, type 22 is removal of the point, type 33 is the query to compute the minimum number of points required to make AA symmetrical.

It is guaranteed that there are no more than 10510^5 queries of type 33 and no more than 10510^5 queries having type 11 or 22 .

输出格式

For each query of the third type output a line with a single integer — the answer to this query.

输入输出样例

  • 输入#1

    12
    1 1 6
    1 6 1
    1 5 5
    1 2 3
    3 4 4
    1 3 2
    3 7 7
    2 2 3
    2 6 1
    3 8 8
    2 5 5
    3 1 1
    

    输出#1

    1
    0
    2
    2
    
  • 输入#2

    6
    1 1 2
    3 1 1
    1 1 1
    3 2 2
    2 1 1
    3 2 4
    

    输出#2

    1
    1
    0
    

说明/提示

The first example is shown on the picture below.

首页