#P7101. [W1] 推

[W1] 推

Description

There is a point set, initially empty.
There are NN operations. In each operation, a point is inserted into or deleted from the point set. After each step, you are asked for the sum of the eighth powers of the areas of all triangles that can be formed from the current point set.

Each answer can be written as a/ba/b, where aa and bb are coprime. Output ab1(mod998244353)a\cdot b^{-1}\pmod{998244353}.

Input Format

The first line contains a positive integer NN, the number of steps.
The next NN lines each contain three positive integers t,x,yt,x,y.
If t=1t=1, insert the point (x,y)(x,y); if t=2t=2, delete the point (x,y)(x,y).

Output Format

Output NN lines.
On the ii-th line, output a positive integer, the answer after the ii-th step.

7
1 0 0
1 0 1
1 2 0
2 2 0
1 4 0
2 4 0
1 6 0
0
0
1
0
256
0
6561
5
1 0 0
1 0 1
1 1 0
1 1 1
2 0 1
0
0
994344961
982646785
994344961

Hint

For 10%10\% of the testdata, N10N\le 10.
For 30%30\% of the testdata, N103N\le 10^3.
For another 10%10\% of the testdata, there are no deletion operations.
For 100%100\% of the testdata, 1N1051\le N\le 10^5 and 0x,y<9982443530\le x,y<998244353. Any point to be deleted is guaranteed to exist beforehand.

Translated by ChatGPT 5