
#include <math.h>
#include <algorithm>
using namespace std;
int n, L, w, x, r, cnt;
struct note {
double x, y;
} a[15010];
bool cmp(note x, note y) {
return x.x < y.x;
}
void read() {
int i;
cnt = 1;
scanf("%d%d%d", &n, &L, &w);
for (i = 1; i <= n; i++) {
scanf("%d%d", &x, &r);
if (r > w / 2) {
a[cnt].x = x - sqrt(r * r - w * w / 4.0);
a[cnt].y = x + sqrt(r * r - w * w / 4.0);
cnt++;
}
}
}
void solve() {
double s, t = 0;
int ans = 0;
int i = 1;
while (t < L) {
s = t;
for (; a[i].x <= s && i <= cnt; i++) {
if (a[i].y > t)
t = a[i].y;
}
if (s == t) {
printf("-1\n");
break;
}
ans++;
}
if (t >= L)
printf("%d\n", ans);
}
int main() {
int t;
scanf("%d", &t);
while (t--) {
read();
sort(a + 1, a + 1 + cnt, cmp);
solve();
}
return 0;
}