#include <bits/stdc++.h>
using namespace std;
void cpp() {}
long long helper(long long x1, long long y1, long long x2, long long y2) {
  if (x1 != 1) {
    x2 = x2 - (x1 - 1);
  }
  if (y1 != 1) {
    y2 = y2 - (y1 - 1);
  }
  long long a = x2 - 1;
  long long b = 1 + (y2 - 1) * a;
  return b;
}
signed main() {
  cpp();
  long long t;
  cin >> t;
  while (t--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x2 < x1 || y2 < y1) {
      cout << "0" << endl;
      continue;
    }
    if ((x1 == x2) || (y1 == y2)) {
      cout << "1" << endl;
      continue;
    }
    cout << helper(x1, y1, x2, y2) << endl;
  }
}
