CF856E.Satellites

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Real Cosmic Communications is the largest telecommunication company on a far far away planet, located at the very edge of the universe. RCC launches communication satellites.

The planet is at the very edge of the universe, so its form is half of a circle. Its radius is rr , the ends of its diameter are points AA and BB . The line ABAB is the edge of the universe, so one of the half-planes contains nothing, neither the planet, nor RCC satellites, nor anything else. Let us introduce coordinates in the following way: the origin is at the center of ABAB segment, OXOX axis coincides with line ABAB , the planet is completely in y>0 half-plane.

The satellite can be in any point of the universe, except the planet points. Satellites are never located beyond the edge of the universe, nor on the edge itself — that is, they have coordinate y>0 . Satellite antennas are directed in such way that they cover the angle with the vertex in the satellite, and edges directed to points AA and BB . Let us call this area the satellite coverage area.

The picture below shows coordinate system and coverage area of a satellite.

When RCC was founded there were no satellites around the planet. Since then there have been several events of one of the following types:

  1. 1 x y — launch the new satellite and put it to the point (x,y)(x,y) . Satellites never move and stay at the point they were launched. Let us assign the number ii to the ii -th satellite in order of launching, starting from one.
  2. 2 i — remove satellite number ii .
  3. 3 i j — make an attempt to create a communication channel between satellites ii and jj . To create a communication channel a repeater is required. It must not be located inside the planet, but can be located at its half-circle border, or above it. Repeater must be in coverage area of both satellites ii and jj . To avoid signal interference, it must not be located in coverage area of any other satellite. Of course, the repeater must be within the universe, it must have a coordinate y>0 .

For each attempt to create a communication channel you must find out whether it is possible.

Sample test has the following satellites locations:

输入格式

The first line of input data contains integers rr and nn — radius of the planet and the number of events ( 1<=r<=1091<=r<=10^{9} , 1<=n<=51051<=n<=5·10^{5} ).

Each of the following nn lines describe events in the specified format.

Satellite coordinates are integer, the satisfy the following constraints x<=109|x|<=10^{9} , 0<y<=10^{9} . No two satellites that simultaneously exist can occupy the same point. Distance from each satellite to the center of the planet is strictly greater than rr .

It is guaranteed that events of types 22 and 33 only refer to satellites that exist at the moment. For all events of type 33 the inequality iji≠j is satisfied.

输出格式

For each event of type 33 print «YES» on a separate line, if it is possible to create a communication channel, or «NO» if it is impossible.

输入输出样例

  • 输入#1

    5 8
    1 -5 8
    1 -4 8
    1 -3 8
    1 2 7
    3 1 3
    2 2
    3 1 3
    3 3 4
    

    输出#1

    NO
    YES
    YES
    
首页