#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<ll,ll>
#define x first
#define y second
const ll M=1e6+7;
ii a[M];
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        ll m;
        cin>>m;
        for(ll i=1;i<=n;i++)
        {
            cin>>a[i].x>>a[i].y;
        }
        bool check1=false;
        for(ll i=1;i<=n;i++)
        {
            ll kq=0;
            for(ll j=1;j<=n;j++)
            {
                kq=max(kq,abs(a[i].x-a[j].x)+abs(a[i].y-a[j].y));
            }
            if(kq<=m)
            {
                check1=true;
            }
        }
        if(!check1)
        {
            cout<<-1;
        }
        else
        {
            cout<<1;
        }
        cout<<endl;
    }
}
