#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int main() {
  int t;
  cin >> t;
  long long xa, xb, ya, yb;
  while (t--) {
    scanf("%lld %lld", &xa, &ya);
    scanf("%lld %lld", &xb, &yb);
    long long ans = (yb - ya) * (xb - xa) + 1;
    printf("%lld\n", ans);
  }
  return 0;
}
