Follow the practice of the given code for the output.
Here are some hints for the sample below.
Dot product of two points $p$ and $q$, is here, defined as the dot product from $0$ to $p$ and $0$ to $q$. Specifically, if $p=(a, b)$, $q=(c, d)$, dot product of $p$ and $q$ is $ac+bd$.
For sample input one, the queries are:
- Query: return $(0, 0)$.
- Add 1st point: $(518204527, -960426430)$.
- Query: return $(1, 1)$.
The answer is $20190812 \cdot 1 + 1 = 20190813$.
For sample input two, the modifications and queries are:
- Add 1st point: $(-258558241, -773369213)$.
- Query: return $(1, 1)$.
- Add 2nd point: $(150662440, -65439273)$.
- Query: return $(1, 2)$.
- Add 3rd point: $(-888171126, -337111254)$.
- Erase 3rd point added among all still alive, so 3rd was erased.
- Query: return $(1, 2)$.
- Add 4th point: $(-470261300, 657949534)$.
- Add 5th point: $(-592507383, 366158932)$.
- Add 6th point: $(635425367, 329355360)$.
- Query: return $(1, 6)$.
- Add 7th point: $(900114299, 534416578)$.
- Erase 5th point added among all still alive, so 6th was erased.
- Query: return $(1, 7)$.
- Erase 2nd point added among all still alive, so 2nd was erased.
- Query: return $(1, 7)$.
Sample input three decodes to be as follows:
- Add 1st point: $(-457246811, -252726229)$.
- Add 2nd point: $(-815357226, 987160210)$.
- Add 3rd point: $(689370621, -861950583)$.
- Add 4th point: $(-850699215, -38670848)$.
- Add 5th point: $(187488045, -980321149)$.
- Add 6th point: $(217752313, -264046720)$.
- Query: return $(2, 3)$.
- Erase 2nd point added among all still alive, so 2nd was erased.
- Query: return $(3, 4)$.
- Erase 3rd point added among all still alive, so 4th was erased.
- Query: return $(1, 3)$.
- Erase 1st point added among all still alive, so 1st was erased.
- Query: return $(6, 6)$.
- Erase 3rd point added among all still alive, so 6th was erased.
- Query: return $(3, 5)$.
- Erase 1st point added among all still alive, so 3rd was erased.
- Query: return $(5, 5)$.
- Erase 1st point added among all still alive, so 5th was erased.
- Query: return $(0, 0)$.