#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long M = 1000000007;
long long power(long long a, long long b) {
  long long res = 1;
  while (b != 0) {
    if (b & 1) {
      res = (res * a) % M;
    }
    a = (a * a) % M;
    b = b >> 1;
  }
  return res % M;
}
long long factorial(long long n) {
  long long ans = 1;
  for (long long i = 1; i <= n; i++) {
    ans = (ans % M) * (i % M);
  }
  return ans % M;
}
long long ncr(long long n, long long r) {
  long long fact_n = factorial(n);
  long long fact_r = factorial(r);
  long long fact_t = factorial(n - r);
  long long inverse_r = power(fact_r, M - 2);
  long long inverse_t = power(fact_t, M - 2);
  long long ans = (((fact_n * inverse_r) % M) * inverse_t) % M;
  return ans;
}
void solve() {
  long long n, a, b, c, ans = 0, count = 0, sum = 0;
  long long x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  if (x1 > x2 || y1 > y2) {
    cout << 0 << endl;
    return;
  }
  long long f = abs(x1 - x2);
  long long g = abs(y1 - y2);
  n = f + g - 2;
  long long r = g - 1;
  cout << f * g + 1 << endl;
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
