QOJ.ac

QOJ

Límite de tiempo: 3 s Límite de memoria: 256 MB Puntuación total: 100

#3684. Coaxial Circles

Estadísticas

In a Cartesian coordinate system, Wayne needs you to perform $n$ operations of two types:

  1. 0 x y: Add a circle to the coordinate system with center $(x, y)$ that passes through the origin.
  2. 1 x y: Query whether the point $(x, y)$ is inside (or on the boundary of) all circles added so far, and at least inside (or on the boundary of) one circle.

To simplify your task, it is guaranteed that the centers of the circles are strictly above the $x$-axis (positive $y$-coordinate) and have non-zero $x$-coordinates.

Input

The first line contains an integer $n$.

The next $n$ lines each start with an integer $0$ or $1$, representing the two types of operations.

This is followed by two real numbers $x$ and $y$, the meanings of which are described above.

Output

For each query operation, output "Yes" if the point is inside (or on the boundary of) all circles added so far; otherwise, output "No".

Examples

Input 1

5
0 2.0000 3.0000
0 4.0000 1.0000
1 1.000000 1.000000
0 -3.0000 2.0000
1 1.000000 1.000000

Output 1

Yes
No

Note

As shown in the figure, when the first query is made, circle D has not been added yet, and E is inside circles B and C; when the second query is made, E is not inside circle D.

Constraints

For $30\%$ of the data, $n \leq 1\,000$.

For $40\%$ of the data, the input data can be considered as uncorrelated random numbers.

For another $20\%$ of the data, $n \leq 100\,000$, and the intersection region of the circles will not consist of more than $20$ circular arcs.

For $100\%$ of the data, $n \leq 500\,000$, and the absolute values of all coordinates do not exceed $10\,000$.

The input data guarantees that the $y$-coordinates of the circle centers are positive and the $x$-coordinates are non-zero.

Circle center coordinates are provided with $4$ decimal places, and query point coordinates are provided with $6$ decimal places. Please be careful with precision control.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.