#include <bits/stdc++.h>
#define pi 126262
using namespace std;
const int maxx=1e6+7;
typedef long long ll;

int T,n,k,x[110], y[110];
int check(int id) 
{
	int ans=0;
	for(int i = 0; i < n; i++)
    {
		int dis = abs(x[id] - x[i]) + abs(y[id] - y[i]);
		ans = max(ans, dis);
	}
	return ans;
}

int main() 
{
	cin >> T;
	while(T--) 
    {
        cin >> n >> k;
		for (int i = 0; i < n;i++) 
            cin >> x[i] >> y[i];
		int ans = -1;
		for (int i = 0; i < n; i++)
        {
			if (check(i) <= k) { ans = 1; goto nex;}
		}
		nex:
		printf("%d\n",ans);
	}
	return 0;
}
