#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const unsigned int M = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << (x2 - x1) * (y2 - y1) + 1 << "\n";
  }
  return 0;
}
