#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(pair<int, int> p1, pair<int, int> p2) {
    if (p1.first < p2.first) return false;
    if (p2.first < p1.first) return true;
    return p1.second < p2.second;
  };
};
const long long INF = 1e18L + 5;
const int inf = 1e9 + 5;
long long solve(long long n, long long mini, long long k) {
  for (long long i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (i <= k) mini = min(mini, n / i);
      if ((n / i) <= k) mini = min(mini, i);
    }
  }
  return mini;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test;
  cin >> test;
  while (test--) {
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long x = x2 - x1 + 1;
    long long y = y2 - y1 + 1;
    if (x == 1 || y == 1) {
      cout << 1 << endl;
      continue;
    }
    long long maxi = max(x, y);
    long long mini = min(x, y);
    x = mini;
    y = maxi;
    long long ans = x * (x - 1) + (y - x - 1) * (x - 1) + 1;
    cout << ans << endl;
  }
  return 0;
}
