#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int sz = 1000001;
inline long long mult(long long a, long long b) {
  return (((a % mod) * (b % mod)) % mod);
}
long long mul(long long a, long long b) {
  long long res = 0;
  while (b > 0) {
    if (b & 1) res = res + a;
    a = a << 1;
    b = b >> 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t, tt, tti, n, m, x, y, z, i, j, k, temp, count, o, e, f, ans, sum, l, r,
      mx, mn;
  long long lx, ly, lz, ltemp;
  double fx, fy, fz;
  string s;
  cin >> tt;
  for (tti = 0; tti < tt; ++tti) {
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2 || y1 == y2) {
      cout << 1 << "\n";
      continue;
    }
    lx = x2 - x1;
    ly = y2 - y1;
    cout << mul(lx, ly) + 1 << "\n";
  }
}
