#include <bits/stdc++.h>
using namespace std;
long long n, a[685855], b[576765], i, j, t, x, y, z, b1, b2, a1, a2, u,
    c[677][674], s, o;
int main() {
  cin >> t;
  for (u = 0; u < t; u++) {
    cin >> a1 >> a2 >> b1 >> b2;
    o = b1 - a1 + 1;
    z = b2 - a2 + 1;
    x = min(o, z);
    y = max(o, z);
    if (o == 1 || z == 1) {
      cout << 1 << endl;
      continue;
    }
    cout << (x - 1) * (x - 2) + (x - 1) * (y - x + 1) + 1 << endl;
  }
}
