#include<bits/stdc++.h>
using namespace std;
#define INF INT_MAX
typedef long long ll;
typedef pair<int,int> pii;
const ll mod = 1e9 + 7;
int main()
{
	std::ios::sync_with_stdio(false);
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		vector<ll> x,y;
		for(int i=0;i<n;i++){
			ll u,v;
			cin>>u>>v;
			x.push_back(u);
			y.push_back(v);
		}
		sort(x.begin(),x.end());
		sort(y.begin(),y.end());
		ll distX=n%2?1:x[n/2]-x[n/2-1]+1;
		ll distY=n%2?1:y[n/2]-y[n/2-1]+1;
		cout<<distX*distY<<endl;
	}
	return 0;
}
