#P7104. 「C.E.L.U-01」超越维度

「C.E.L.U-01」超越维度

Description

Little Soup and Luo Si Ji give you nn operations.
Operation 11: Little Soup adds a regular (axis-aligned) kk-dimensional hypercube into the kk-dimensional space.
Operation 22: Luo Si Ji gives a regular (axis-aligned) kk-dimensional hypercube. Compute the volume of the intersection between the currently existing hypercubes and this hypercube, then output the value mod 1919810 \text{mod}\ 1919810\ .

Input Format

The first line contains two integers n,kn, k, as explained above.
Lines 22 to n+1n+1 each contain k+2k+2 numbers. The first number is the operation type. The next kk numbers are the coordinates of the center of the regular kk-dimensional hypercube in the kk-dimensional coordinate system. The last number is the distance from this center to each (k1)(k-1)-dimensional hyperplane (they are all equal).

Output Format

For each operation 22, output one number.

3 2
1 1 1 1
1 2 2 1
2 1 2 1
3
5 3
1 0 0 0 3
1 1 -1 0 1
2 0 0 0 2
1 19 3 5 6
2 1 0 0 30

64
1944
10 2
1 7 5 4 
1 2 4 2 
2 2 2 2 
1 5 5 3 
1 2 2 0 
2 5 3 4 
2 6 0 1 
1 0 9 0 
1 4 6 0 
2 4 0 0
9
45
0
0

Hint

Explanation for Sample 1:
As shown in the figure, the orange boxes are the two added squares, the green box is the query, and the green area is the answer.

Explanation for Sample 3:

As shown in the figure (the red marked part is the answer for Query 2) (the two explanations were not made by the same person):

Constraints

$\begin{array}{|c|c|c|}\text{Testdata ID}&n&k\\1&500&1\\2\sim3&500&2\\4\sim6&500&3\\7\sim10&500&\le6\end{array}$
The input and output numbers are within the long long\text{long long} range. The testdata is guaranteed to be random (the regular kk-dimensional hypercubes are relatively scattered).

Translated by ChatGPT 5