#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long dx = x2 - x1 + 1;
    long long dy = y2 - y1 + 1;
    long long n = dy + (dx - 1);
    auto sumN = [](long long x) { return (x * x + x) / 2LL; };
    long long res = 2LL * sumN(min(dx, dy) - 1);
    long long m = n - 2LL - (2LL * (min(dx, dy) - 1));
    res += (m * (min(dx, dy) - 1));
    cout << res + 1 << "\n";
  }
}
