#include <bits/stdc++.h>

using namespace std;

typedef vector<char> vc;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tuple<int, ll, ll> edge;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;
typedef tuple<double, double, double> ddd;
typedef vector<vector<int>> vvi;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define LSOne(S) ((S) & -(S))
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}



template<typename T>
void printV(const T& t) {
  std::copy(t.cbegin(), t.cend(), std::ostream_iterator<typename T::value_type>(std::cout, " "));
  cout << "\n";
}
template<typename T>
void printVV(const T& t) {
  for(int i = 0; i < t.size(); i++) {
    printf("%d: ", i);
    printV(t[i]);
  }
  // std::for_each(t.cbegin(), t.cend(), printV<typename T::value_type>);
}
template<typename T, typename S>
void printVP(vector<pair<T, S>> vp) {
  if (vp.empty()) {
    cout << "\n";
    return;
  }
  for(int i = 0; i < vp.size() - 1; i++) {
    cout << "(" << vp[i].first << " " << vp[i].second << ") ";
  }
  cout << "(" << vp[vp.size() - 1].first << " " << vp[vp.size() - 1].second << ")\n";
}
template<typename T>
void printVVP(vector<vector<pair<T, T>>> vvp) {
  for(int i = 0; i < vvp.size(); i++) {
    cout << i << ": ";
    printVP(vvp[i]);
  }
}
// use to tokenize stuff
vector<string> split(const string &s, char delim) {
  vector<string> result;
  stringstream ss(s);
  string item;
  while (getline(ss, item, delim)) {
    result.push_back(item);
  }
  return result;
}

// only for positive integers
bool is_number(const string &s) {
    string::const_iterator it = s.begin();
    while (it != s.end() && isdigit(*it)) ++it;
    return !s.empty() && it == s.end();
}
void fast() { // call to set faster IO
    ios::sync_with_stdio(false);
    cin.tie(NULL); // cout.tie(NULL);
}
bool isValid(int r, int c, int R, int C) {
  return (r >= 0 && r < R && c >= 0 && c < C);
}
struct Can {
  ll x, r, id;
};
bool compareByX(const Can &lhs, const Can &rhs) {
  return lhs.x < rhs.x;
}
class Person {
public:
  string name, speak;
  unordered_set<string> understands;

  friend ostream& operator<<(ostream& os, const Person &p) {
    os << p.name << '(' << p.speak << "):";
    for(auto s : p.understands) os << " " << s;
    return os;
  }
};

vector<pair<int, int>> deltas = {{-1,0}, {0, 1}, {1, 0}, {0,-1}};
// vector<int> numDays = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
// vector<int> cumDays;
const int INF = 1e9 + 10;
const ll inf = 1e18 + 10;
const long double PI = 3.14159265359;

// important bit functions
// __builtin_ctz(4) // count trailing zeros, this is 2
// __builtin_popcount(11) // count number of set bits, 11 is (1011)_2, so this is 3
// cout << std::bitset<8>(a) << "\n"; // output as binary



int nummed(vector<int> &A) {
  int N = A.size();
  sort(A.begin(), A.end());
  if (N % 2 == 0) {
    int hi = A[N/2];
    int lo = A[N/2 - 1];
    return (hi - lo + 1);
  } else {
    return 1;
  }
}

int main() {
  int TC; cin >> TC;
  while(TC--) {
    int N; cin >> N;
    vector<int> X(N), Y(N);
    rep(i,0,N) {
      cin >> X[i];
      cin >> Y[i];
    }

    int mx = nummed(X);
    int my = nummed(Y);
    ll ans = mx * (ll) my;
    cout << ans << '\n';
  }
}