#include <iostream>
#include <algorithm>

using namespace std;

const int MAXN = 1000;
int posx[MAXN], posy[MAXN];
int pointarr1[MAXN], pointarr2[MAXN];

bool cmpx(int p1, int p2) {
    return posx[p1] < posx[p2];
}
bool cmpy(int p1, int p2) {
    return posy[p1] < posy[p2];
}

typedef long long ll;

int main() {
    int t;
    cin >> t;

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

        for (int i=0; i<n; i++) {
            cin >> posx[i] >> posy[i];
        }

        for (int i=0; i<n; i++) {
            pointarr1[i] = i;
            pointarr2[i] = i;
        }

        sort(pointarr1, pointarr1+n, cmpx);
        sort(pointarr2, pointarr2+n, cmpy);

        int w = (n%2? 1: posx[pointarr1[n/2]]-posx[pointarr1[n/2-1]]+1);
        int h = (n%2? 1: posy[pointarr2[n/2]]-posy[pointarr2[n/2-1]]+1);

        cout << (ll(w)*h) << endl;
    }
}
