#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long x1, u1, x2, u2;
  scanf("%lld%lld%lld%lld", &x1, &u1, &x2, &u2);
  long long r = x2 - x1;
  long long c = u2 - u1;
  long long lower = (r) * (r + 1ll) / 2ll;
  cout << (c)*r + 1ll << endl;
}
int main() {
  int t;
  cin >> t;
  while (t) {
    --t;
    solve();
  }
  return 0;
}
