#include <bits/stdc++.h>
using namespace std;
const long long mod = 10001;
const long long N = 2e5 + 10;
const double eps = 1e-4;
long long gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
int a[N];
void solve() {
  int x1, x2, y1, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  if (x1 == x2 || y1 == y2)
    cout << "1\n";
  else {
    int x = abs(x1 - x2);
    int y = abs(y1 - y2);
    long long k = x + y;
    long long any = (k - x) * x;
    cout << any + 1 << "\n";
  }
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
