#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define pb push_back
#define pob pop_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define rf0(i,n) for(i=n-1;i>=0;i--)
#define f2(i,n) for(i=1;i<n;i++)
#define f1(i,n) for(i=1;i<=n;i++)
#define fab(i,a,b) for(i=a;i<=b;i++)
#define shr  ll t;cin>>t; while(t--)
#define fi first
#define sc second
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpll vector<pll>
#define all(v) v.begin(),v.end()
#define mod 1000000007
#define dev(a) for(auto it:a)cout<<it<<" "
#define prec(nm,prc) cout<<fixed << setprecision(nm)<<prc
#define print(a) cout<<a<<endl;
#define nl '\n'
using namespace std;
bool comp(pll &a,pll &b)
{
    return (a.sc<b.sc);
}
ll power(ll n,ll p)
{
	if(p==0)
	return 1;
	else
	{
		ll ans=power(n,p/2)%mod;
		ans=(ans*ans)%mod;
		if(p%2==0)
		return ans;
		else
		return ans=(ans*n)%mod;
	}
}
bool isPrime(ll n) 
{ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
  
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (ll i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
} 


    /********************HAR HAR MAHADEV***********JAI BAJRANG BALI************************/
  int main()
 {
  	FAST;
  	/* ifstream cin;
    cin.open("input.txt");
    ofstream cout;
    cout.open("output.txt");
                      */
  	shr
  	  {  
  	  	ll i,j,n,a,b,c,c1,d,m,sum=0,temp,k,k2,k1,ans=0,cnt=0,r=0,e=0,f;
  	  	string str,stri,om,s;
  	     map<ll,ll>mp,mp1;
  	     set<ll>st; vector<vll> v;
  	     cin>>n>>k; ll x[n][2];
  	     f0(i,n)
  	     {
  	         cin>>x[i][0]>>x[i][1];
  	     }
  	    f0(i,n)
  	    {
          vll vk;
           f0(j,n)
          {
              
              if(i!=j)
              {
                  vk.pb(abs(x[i][0]-x[j][0])+abs(x[i][1]-x[j][1]));
              }
             
          }
           v.pb(vk);
          r++;
      }
  	   f0(i,v.size())
  	   {
      ll p=*max_element(all(v[i]));
      if(p<=k){e=1;break;}
      }
      if(e==1)cout<<1;
      else cout<<-1;
      cout<<endl;
  	  }
  	  
   	return 0;
  }                     
 