#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long a = (x2 - x1 + 1), b = (y2 - y1 + 1);
    if (a > b) swap(a, b);
    if (a == 1)
      cout << 1 << endl;
    else {
      long long ans = (a - 1) * (a - 1) + 1 + (a - 1) * (b - a);
      cout << ans << endl;
    }
  }
  return 0;
}
