#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
long long int modd = 998244353;
vector<bool> isprime(N);
void seive() {
  isprime[0] = false;
  isprime[1] = false;
  for (int i = 2; i * i <= 1e6; i++) {
    if (isprime[i]) {
      for (int j = i * i; j <= 1e6; j += i) {
        isprime[j] = false;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  seive();
  int test;
  cin >> test;
  while (test--) {
    long long int x, y, a, b;
    cin >> x >> y >> a >> b;
    long long int ans = (a - x) * (b - y);
    ans++;
    cout << ans << endl;
  }
  return 0;
}
