#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long n = abs(x1 - x2), m = abs(y1 - y2);
    if (n > m) swap(n, m);
    n++;
    m++;
    long long x = n * (n - 1) + (m - (n + 1)) * (n - 1);
    cout << x + 1 << endl;
  }
}
