#include <bits/stdc++.h>
using namespace std;
long long hcf(long long x, long long y) {
  if (x == 0) return y;
  return hcf(y % x, x);
}
long long lcm(long long a, long long b) { return ((a * b) / hcf(a, b)); }
vector<long long> all_prime(long long n) {
  vector<long long> sieve(n + 1, 0);
  for (long long x = 2; x <= n; x++) {
    if (sieve[x]) continue;
    for (int u = 2 * x; u <= n; u += x) {
      if (sieve[u] == 0) {
        sieve[u] = x;
      }
    }
  }
  return sieve;
}
long long power(long long x, long long n) {
  if (n == 0) return 1;
  long long temp = power(x, n / 2);
  if (n % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << (x2 - x1) * (y2 - y1) + 1 << "\n";
  }
}
