#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long x1, y1;
    cin >> x1 >> y1;
    long long x2, y2;
    cin >> x2 >> y2;
    long long n = x2 - x1;
    long long m = y2 - y1;
    long long mint = min(n, m);
    long long ans = 0;
    if (mint == 0)
      ans = 1;
    else {
      ans += n * m + 1;
    }
    cout << ans << "\n";
  }
}
