#P9996. [Ynoi2000] hpi
[Ynoi2000] hpi
Problem Description
Given pairwise distinct points and queries. Each query gives . You need to count the number of pairs that satisfy , , , and .
Input Format
The first line contains two integers .
The next lines each contain two integers , for .
The next lines each contain three integers, representing a query .
Output Format
For each query, output one line containing one integer, which is the answer to this query.
5 2
2003 -553
-141 1230
-6854 9658
9319 -1777
7773 3306
1113 -3086 -15864589
162 550 -21287
0
1
Hint
Idea: nzhtl1477 & ccz181078, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
Constraints: For of the testdata, , , , . The are chosen uniformly at random, but it is guaranteed that there are no duplicate points.
For of the testdata, .
For another of the testdata, .
For another of the testdata, .
For another of the testdata, there are no special constraints.
Translated by ChatGPT 5