#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1010;
struct node{
    int x, y;
} p[N];
int n;
bool cmp1(node A, node B) {
    return A.x < B.x;
}
bool cmp2(node A, node B) {
    return A.y < B.y;
}
inline void solve() {
    cin >> n;
    for (int i = 1; i <= n; i ++ ) {
        cin >> p[i].x >> p[i].y;
    }
    sort(p + 1, p + 1 + n, cmp1);
    LL row, col;
    if (n & 1) col = 1;
    else {
        LL tmp1 = p[n / 2].x, tmp2 = p[n / 2 + 1].x;
        col = tmp2 - tmp1 + 1;
    }
    sort(p + 1, p + 1 + n, cmp2);
    if (n & 1) row = 1;
    else {
        LL tmp1 = p[n / 2].y, tmp2 = p[n / 2 + 1].y;
        row = tmp2 - tmp1 + 1;
    }
    cout << row * col << endl;
}
int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int t; cin >> t;
    while (t -- )
        solve();
    return 0;
}