#include <bits/stdc++.h>
using namespace std;
int a[200005];
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x, y, xx, yy;
    cin >> x >> y >> xx >> yy;
    long long a, b;
    a = xx - x;
    b = yy - y;
    long long ans = min(a, b);
    cout << ans * (ans + 1) + ans * (a + b - 1 - ans * 2) + 1 << endl;
  }
  return 0;
}
