#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 10;
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2 || y1 == y2) {
      cout << "1" << endl;
      continue;
    }
    long long lenx = x2 - x1;
    long long leny = y2 - y1;
    long long len = min(lenx, leny);
    long long ans = len * (len + 1);
    ans += (lenx + leny - 1 - 2 * len) * len;
    cout << ans + 1 << endl;
  }
  return 0;
}
