P17656 [IO 2025 #3] Death Ray
Description
Wednesday loves playing with toys in her room, and she especially loves burning them to ashes with her death ray. View her room as a Cartesian plane, so the position of each toy can be described by integer coordinates $(x,y)$. During the game, she performs $n$ changes one by one, each of one of the following two types:
- `+ x y`: place a toy at the point $(x,y)$.
- `- x y`: remove the toy at the point $(x,y)$.
Wednesday's death ray travels along some straight line and burns every toy on that line to ashes. After each change, she wants to know: is there a straight line such that firing the death ray along it would destroy all the toys in the room?
Input Format
The first line contains an integer $n$ — the number of changes, $1\le n\le 2\cdot 10^5$.
Each of the next $n$ lines describes one change. Each line starts with the character `+` or `-`, followed by two integers $x,y$, satisfying $|x|,|y|\le 10^9$.
If the line starts with `+`, Wednesday places a toy at the point $(x,y)$. It is guaranteed that there is no toy at that point at this moment. If the line starts with `-`, she removes the toy at the point $(x,y)$. It is guaranteed that there is a toy at that point at this moment.
Output Format
Output $n$ lines. On the $i$-th line, print `YES` or `NO`, answering Wednesday's question after the $i$-th change. The case does not matter.
Explanation/Hint
Translated by QwenWork