#include <iostream>
#include <algorithm>
#include <vector>
#define mk make_pair
using namespace std;
typedef long long ll;

const int maxn = 1e3 + 5;
vector <ll > X, Y;
int main() {
	int t; cin >> t;
	while (t--) {
		int n; scanf("%d", &n);
		X.clear(), Y.clear();
		for (int i = 1, l, r; i <= n; ++i) {
			scanf("%d%d", &l, &r);
			X.push_back(l);
			Y.push_back(r);
		}
		sort(X.begin(), X.end());
		sort(Y.begin(), Y.end());
		if (n & 1) {
			cout << 1 << endl;
			continue;
		} else {
			cout << (X[n / 2] - X[n / 2 - 1] + 1)
			* (Y[n / 2] - Y[n / 2 - 1] + 1) << endl;
		}
		
		
	}
	return 0;
} 