Give a chessboard of M ∗ M , with N point on it. You should calculate how many solutions there ar to
select 3 points to make the median distance between the distance between the 3 points is a prime number?
the distance between (x1,y1) and (x2,y2) is |x1 − x2| + |y1 − y2|
输入格式
Each test contains multiple test cases. The first line contains the number of test cases T(1 ≤ T ≤ 10).
Description of the test cases follows.
The first line of each test case contains two integers N,M
The next N lines each line contains two integers x i ,y i
It’s guaranteed there are no i,j(i 6= j) satisfies both x i = x j and y i = y j
1 ≤ N ≤ 2000,1 ≤ M ≤ 10 5 ,1 ≤ x i ,y i ≤ M
输出格式
For each test case, print one integer — the answer to the problem.