#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 12;
long long mod = 1e9 + 9;
long long a, b, c, d, ans;
void solve() {
  cin >> a >> b >> c >> d;
  long long ans = ((c - a) * (d - b)) + 1LL;
  cout << ans;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
