#include <bits/stdc++.h>
using namespace std;
const long long INF = 2000000000000000000LL;
const int inf = 0x3f3f3f3f;
const long double EPS = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int test, tc = 1;
  cin >> test;
  while (test--) {
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long p = (x2 - x1);
    long long q = (y2 - y1);
    cout << (p * q) + 1 << endl;
  }
  return 0;
}
