#P8513. [Ynoi Easy Round 2021] TEST_136
[Ynoi Easy Round 2021] TEST_136
Problem Description
Given points , . There are query operations. In each query, are given. You need to find the number of ordered pairs such that , , and .
Input Format
The first line contains two integers .
The next lines each contain three integers , .
The next lines each contain three integers .
Output Format
Output lines. Each line contains one integer, the answer to the corresponding query.
5 2
2 -1 1
0 -3 5
1 -3 2
1 3 5
3 2 2
1 2 4
1 -2 -9
2
9
Hint
Idea: nzhtl1477, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
Sample explanation:
The first query corresponds to .
The second query corresponds to .
Constraints:
For of the testdata, .
For another of the testdata, .
For another of the testdata, .
For another of the testdata, for every , .
For another of the testdata, .
For another of the testdata, .
For the remaining testdata, there are no special constraints.
Each part of the testdata forms a subtask, and the subtasks are independent.
All testdata satisfy:
.
.
.
.
.
All values are integers.
When , or .
For all testdata except subtask 4, the coordinates of the points are chosen uniformly at random within some preset intervals, and it is guaranteed that there are no duplicate points. For the -th point, and are chosen independently at random, but the distribution of has no special restrictions.
Translated by ChatGPT 5