#include <bits/stdc++.h>
using namespace std;
long long digits(long long n) {
  long long cnt = 0;
  while (n > 0) {
    cnt++;
    n = n / 10;
  }
  return cnt;
}
long long nck(long long n, long long k) {
  long long C[n + 1][k + 1];
  long long i, j;
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= min(i, k); j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
    }
  }
  return C[n][k];
}
long long modularExponentiation(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) {
      result = ((result % M) * (x % M)) % M;
    }
    x = ((x % M) * (x % M)) % M;
    n = n / 2;
  }
  return result % M;
}
long long LCSubStr(string X, string Y, long long m, long long n) {
  long long LCSuff[m + 1][n + 1];
  long long result = 0;
  for (long long i = 0; i <= m; i++) {
    for (long long j = 0; j <= n; j++) {
      if (i == 0 || j == 0)
        LCSuff[i][j] = 0;
      else if (X[i - 1] == Y[j - 1]) {
        LCSuff[i][j] = LCSuff[i - 1][j - 1] + 1;
        result = max(result, LCSuff[i][j]);
      } else
        LCSuff[i][j] = 0;
    }
  }
  return result;
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long ans = (c - a) * (d - b) + 1;
    cout << ans << endl;
  }
}
