#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    unsigned long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    unsigned long long ans = 1 + ((x2 - x1) * (y2 - y1));
    cout << ans << "\n";
  }
  return 0;
}
