#P15871. 【MX-X26-T7】「Cfz Round 7」**终极 AVX2 硬件指令提速**
【MX-X26-T7】「Cfz Round 7」**终极 AVX2 硬件指令提速**
Problem Description
Given an array of length and a 2D plane containing "fish", the coordinates of the -th "fish" are , with a weight interval .
There are queries. Each query provides . Define if and only if ; otherwise, . Define the set as the set of all integers that lie in the union of over all satisfying . Compute .
Input Format
The first line contains an integer , indicating the subtask ID of this test point. The samples satisfy .
The second line contains two integers .
The next lines: the -th line contains four integers .
The next line contains integers .
The next lines: the -th line contains three integers .
Output Format
For each query, output one line containing one integer, representing the answer.
0
5 2
2 2 4 4
-3 -3 1 1
-3 -1 3 5
1 -1 3 3
-2 3 1 5
12 3955 8019 1664 9231
2 -2 1
3 2 1
22881
18926
Hint
Sample 1 Explanation
For the -st query, only the -rd "fish" and the -th "fish" satisfy the condition. Their weight intervals are and , so . The answer is .
For the -nd query, only the -nd "fish" and the -rd "fish" satisfy the condition. Their weight intervals are and , so . The answer is .
Constraints
For all testdata:
- , .
- For all : , .
- For all : .
- For all : , , .
For testdata other than Subtask 2, it is guaranteed that the coordinates of the "fish" are independently and uniformly randomly chosen within some preset ranges. Also, for the -th "fish", and are independently randomly chosen, but the distribution of has no special restriction.
This problem uses bundled evaluation.
- Subtask 1 (10 points): .
- Subtask 2 (18 points): For all , it is guaranteed that .
- Subtask 3 (18 points): For all , it is guaranteed that .
- Subtask 4 (24 points): , .
- Subtask 5 (30 points): No special restrictions.
Translated by ChatGPT 5