#include<bits/stdc++.h>
using namespace std;
#define int long long

const int N=1000+5;

inline int read()
{
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')
	{
	    if(c=='-')
	        f=-1;
	    c=getchar();
	}
	while(c>='0'&&c<='9')
	{
	    x=x*10+c-'0';
	    c=getchar();
	}
	return x*f;
}

int n;
int x[N],y[N];

signed main()
{
	int T=read();
	while(T--)
	{
		n=read();
		for(int i=1;i<=n;i++)
		{
			x[i]=read(); y[i]=read();	
		}
		sort(x+1,x+n+1); sort(y+1,y+n+1);
		int ans=0;
		if(n%2==0)
		{
			int p1=n/2,p2=n/2+1;
			int cnt1=(x[p2]-x[p1]+1),cnt2=(y[p2]-y[p1]+1);
			printf("%lld\n",cnt1*cnt2);
		}
		else
		{
			printf("1\n");
		}
	}
	return 0;
}