#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cctype>
#include<cstdlib>
#include<ctime>
using std::max;
using std::min;
using std::sort;
const int maxn=1007;
int N;
struct node{
    int x,y;
}A[maxn];
bool com1(const node &x,const node &y) {return x.x<y.x||x.x==y.x&&x.y<y.y;}
bool com2(const node &x,const node &y) {return x.y<y.y||x.y==y.y&&x.x<y.x;}
typedef long long LL;
LL abs_(const LL &x) {return x>=0?x:-x;}
int T=1;
LL calcx(int xi)
{
    LL re=0;
    for(int i=1;i<=N;i++)
        re+=abs_(A[i].x-xi);
    return re;
}
LL calcy(int yi)
{
    LL re=0;
    for(int i=1;i<=N;i++)
        re+=abs_(A[i].y-yi);
    return re;
}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
    #endif
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d",&N);
        for(int i=1;i<=N;i++)
            scanf("%d%d",&A[i].x,&A[i].y);
        sort(A+1,A+1+N,com1);
        LL re=1e18;
        int l,r;
        for(int i=1;i<=N;i++)
            re=min(re,calcx(A[i].x));
        for(int i=1;i<=N;i++)
        if(calcx(A[i].x)==re) {l=i;break;}
        for(int i=N;i>0;i--)
        if(calcx(A[i].x)==re) {r=i;break;}
        int x=A[r].x-A[l].x+1;
        sort(A+1,A+1+N,com2);
        re=1e18;
        for(int i=1;i<=N;i++)
            re=min(re,calcy(A[i].y));
        for(int i=1;i<=N;i++)
        if(calcy(A[i].y)==re) {l=i;break;}
        for(int i=N;i>0;i--)
        if(calcy(A[i].y)==re) {r=i;break;}
        int y=A[r].y-A[l].y+1;
        printf("%lld\n",1ll*x*y);
    }
    return 0;
}