You are given people standing at different positions on a 2D grid. Each person is located at a point with integer coordinates .
Two people are considered neighbors if the Manhattan distance between them is at most a given integer .
The Manhattan distance between two points (x_1, y_1) and (x_2, y_2) is defined as
Your task is to determine, for each person, how many other people are neighbors.
The first line contains a single integer (1 \le t \le 10^4)—the number of test cases.
The first line of each test case contains two integers and (1 \le n \le 10^5, 1 \le d \le 3)—the number of people and the distance threshold.
Each of the next lines contains two integers x_i and y_i (-10^9 \le x_i, y_i \le 10^9)—the coordinates of the -th person.
It is guaranteed that the sum of over all test cases does not exceed 10^5.
It is guaranteed that all points are pairwise distinct.
Print integers in a single line. The -th integer should represent the number of people (excluding the person themself) whose Manhattan distance from the -th person is less than or equal to .
Example 1
Consider the first test case:
Point . There are exactly points considered neighbors: , , .
Point . There are exactly points considered neighbors: , , .
Point . There are exactly points considered neighbors: , , .
Point . There are exactly points considered neighbors: , , .
Point . There are exactly points considered neighbors: , , , .
All of them have a distance of at most d = 2.
Subtask ( points): 1 \le n \le 10
Subtask ( points): 1 \le n \le 1000
Subtask ( points): d = 1
Subtask ( points): -1000 \le x_i, y_i \le 1000
Subtask ( points): No additional constraints.