#include <bits/stdc++.h>
// #define int long long
#define LL long long
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef pair<double, double> PDD;
const int N = 1.5e4 + 10;
int n, t;
double l, w;
PDD seg[N];
PDD get_dist(double pos, double r)
{
double dx = sqrt(r * r - (w / 2) * (w / 2));
return {pos - dx, pos + dx};
}
signed main()
{
IOS;
cin >> t;
while (t -- )
{
cin >> n >> l >> w;
int cnt = 0;
for (int i = 1; i <= n; i ++ )
{
double pos, r;
cin >> pos >> r;
if (r <= w / 2) continue;
seg[cnt ++ ] = get_dist(pos, r);
}
sort(seg, seg + cnt);
int res = 0;
double st = 0, ed = l;
bool success = false;
for (int i = 0; i < cnt; i ++ )
{
int j = i;
double r = -2e9;
while (j < cnt && seg[j].first <= st)
{
r = max(r, seg[j].second);
j ++ ;
}
if (r < st)
{
res = -1;
break;
}
res ++ ;
if (r >= ed)
{
success = true;
break;
}
st = r;
i = j - 1;
}
if (!success) res = -1;
printf("%d\n", res);
}
return 0;
}