#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int test;
  cin >> test;
  while (test--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long a = x2 - x1;
    long long b = y2 - y1;
    if (a == 0 || b == 0) {
      cout << 1 << "\n";
      continue;
    } else {
      cout << a * b + 1 << "\n";
    }
  }
}
