#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define int long long
#define double long double
#define fr(n) for(int i=0;i<n;i++)
#define sortv(a) sort(a.begin(),a.end())
#define pb push_back
#define endl "\n"
#define pii pair<int,int>
const int N = 1e6+5;
const int mod = 998244353;

vector<int> adj[100005];
vector<bool> vis(100005,false);

// int mod = 1e9+7;
int modexpo(int x,int p){
    int res = 1;
    x = x%mod;
    while(p){
        if(p%2)
            res = res * x;
        p >>= 1;
        x = x*x % mod;
        res %= mod;
    }      
    return res;
}


int isprime(int n){
    if(n < 2)
        return 0;
    if(n < 4)
        return 1;
    if(n % 2 == 0 or n % 3 == 0)
        return 0;
    for(int i = 5; i*i <= n; i += 6)
        if(n % i == 0 or n % (i+2) == 0)
            return 0;
    return 1;
}

void pairsort(int a[], int b[], int n){
    pair<int, int> pairt[n];
    for (int i = 0; i < n; i++) 
    {
        pairt[i].first = a[i];
        pairt[i].second = b[i];
    }
    sort(pairt, pairt + n);
    for (int i = 0; i < n; i++) 
    {
        a[i] = pairt[i].first;
        b[i] = pairt[i].second;
    }
}

    


void solve()
{















int n,k;
cin >> n >> k;

int x[n], y[n];

fr(n)
    cin >> x[i] >> y[i];

for(int i=0;i<n;i++)
{
    int maxx = 0;
    for(int j=0;j<n;j++)
    {
        maxx = max(maxx, abs(x[i]-x[j])+abs(y[i]-y[j]));
    }
    if(maxx <= k)
    {
        cout << 1;
        return;
    }
}
cout << -1;












}

int32_t main()
{
    int q = 1;
    cin >> q;
    while(q--)
        solve(),cout << endl;
    return 0;
}
    