#include <iostream>
#include <stdlib.h>
#include <math.h>
//贪心算法
//把点转换成区间
//去掉大区间
//贪心开始...
using namespace std;
struct seat
{
int x; //
int y; //坐标
double left; //
double right; //区间
int flag; //标记,0为去掉
};
int cmp(const void *_a, const void *_b);
bool is_in(seat a, double xy, int r);
int main()
{
int k;
cin >> k;
while(k--)
{
seat a[110];
int n, r;
cin >> n >> r;
for (int i = 0; i < n; i++)
{
cin >> a[i].x >> a[i].y;
a[i].flag = 1;
a[i].left = a[i].x - sqrt(r*r - a[i].y*a[i].y);
a[i].right = a[i].x + sqrt(r*r - a[i].y*a[i].y);
}
qsort(a, n, sizeof(seat), cmp); //按照区间左值排序
for(int i = 0; i < n; i++) //去除大区间
{
for(int j = i+1; j < n; j++)
{
if(a[i].flag == 1 && a[i].left <= a[j].left && a[i].right >= a[j].right)
a[i].flag = 0;
}
}
int count = 0;
double current;
for(int i = 0; i < n; i++)
{
if(a[i].flag == 1)
{
current = a[i].right;
count++;
a[i].flag = 0;
for(int j = i+1; j < n; j++)
{
if(a[j].left <= current && a[j].right >= current)
a[j].flag = 0;
}
}
}
cout << count << endl;
}
}
int cmp(const void *_a, const void *_b)
{
seat *a;
seat *b;
a = (seat *)_a;
b = (seat *)_b;
if(a->left > b->left)
return 1;
if(a->left == b->left)
return 0;
if(a->left < b->left)
return -1;
}