#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long ele = x2 - x1 + y2 - y1 - 1;
    long long diff = min(x2 - x1, y2 - y1);
    long long ti = max(x2 - x1, y2 - y1);
    long long ans = diff * (diff + 1);
    ans += (ele - 2 * diff) * diff;
    cout << ans + 1 << '\n';
  }
}
