#P7101. [W1] 推
[W1] 推
Description
There is a point set, initially empty.
There are 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 , where and are coprime. Output .
Input Format
The first line contains a positive integer , the number of steps.
The next lines each contain three positive integers .
If , insert the point ; if , delete the point .
Output Format
Output lines.
On the -th line, output a positive integer, the answer after the -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 of the testdata, .
For of the testdata, .
For another of the testdata, there are no deletion operations.
For of the testdata, and . Any point to be deleted is guaranteed to exist beforehand.
Translated by ChatGPT 5
京公网安备 11011102002149号