#include <bits/stdc++.h>
using namespace std;
int arr[200005];
const int maxn = 0x3f3f3f3f;
long long ccc(long long a, long long b) {
  long long n = b, m = min(b - a, a);
  long long ans1 = 1, ans2 = 1;
  for (int i = 1; i <= m; i++) {
    ans1 *= (n + 1 - i);
    ans2 *= i;
  }
  return ans1 / ans2;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long x = x2 - x1, y = y2 - y1;
    cout << x * y + 1 << endl;
  }
  return 0;
}
