#include<stdio.h>
#include<math.h>
struct Node
{
double start;
double end;
}a[10000];
void quick_sort(struct Node *arr, int l, int r)
{
if (l < r)
{
int i = l, j = r, x = arr[l].start;
struct Node temp = arr[l];
while (i < j)
{
while (i < j && x <= arr[j].start)
j--;
if (i < j)
arr[i++] = arr[j];
while (i < j && x > arr[i].start)
i++;
if (i < j)
arr[j--]= arr[i];
}
arr[i] = temp;
quick_sort(arr, l ,i - 1);
quick_sort(arr, i + 1, r);
}
}
int main()
{
int m;
scanf("%d",&m);
while (m--)
{
int n, m, num = 1;
double h;
scanf("%d%d%lf",&n, &m, &h);
int i, j;
double x, r;
for (i = 0; i < n; i++)
{
scanf("%lf%lf", &x, &r);
double distance = 0;
if (r < h / 2.0)
{
i--; n--;
continue;
}
distance = sqrt(r * r - (h / 2.0) * (h / 2.0));
a[i].start = x - distance;
a[i].end = x + distance;
}
quick_sort(a, 0, n - 1);
if (a[0].start > 0)
printf("0\n");
else
{
double temp = a[0].end;
int t = 0, s = 1;
for (i = t; i < n; i++)
{
for (j = i + 1; j < n; j++)
{
if (a[j].start < temp && a[j].end > a[t].end)
t = j, s = 0;
}
if (s == 0)
{
temp = a[t].end;
num += 1;
s = 1;
}
if (a[t].end >= m)
break;
}
if (a[t].end >= m)
printf("%d\n",num);
else
printf("0\n");
}
}
return 0;
}