#include<bits/stdc++.h>
#define pb push_back
#define PI 3.141592653589793238462643383279502884197169399375
#define inf 100000000000000000
#define mod 1000000007
#define NMAX 40005

using namespace std;

typedef int64_t ll;

ll fun(vector<ll>& v)
{
    ll n = v.size();

    vector<ll> pre(n, 0);

    pre[0] = v[0];

    for(ll i=1; i<n; ++i)
    {
        pre[i] = pre[i-1]+v[i];
    }

    ll sum = pre.back();

    map<ll,set<ll> > m;

    for(ll i=0; i<n; ++i)
    {
        ll dis = 0;

        if(i>0)
        {
            dis += i*v[i]-pre[i-1];
        }

        if(i<n-1)
        {
            dis += sum-pre[i] - (n-i-1)*v[i];
        }

        m[dis].insert(v[i]);
    }

    set<ll>& myset = ((m.begin())->second);

    set<ll>::iterator it1 = myset.end();

    ll ans = 1;

    for(set<ll>::iterator it=myset.begin(); it!=myset.end(); ++it)
    {
        set<ll>::iterator it2 = it;

        if(it1!=myset.end() && it2!=myset.end())
        {
            ans += (*it2)-(*it1);
        }

        it1 = it2;

    }

    return ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t; cin>>t;

    while(t--)
    {
        ll n; cin>>n;

        vector<ll> v[2];
        v[0] = v[1] = vector<ll>(n);

        for(ll i=0; i<n; ++i)
        {
            cin>>v[0][i]>>v[1][i];
        }

        sort(v[0].begin(), v[0].end());
        sort(v[1].begin(), v[1].end());

        ll x = fun(v[0]);
        ll y = fun(v[1]);

        ll ans = x*y;

        cout<<ans<<endl;

    }

    return 0;

}
