#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  long long n = x2 - x1, m = y2 - y1;
  long long ans = n * m + 1;
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
