#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const double PI = acos(-1);
const int MOD = 998244353;
const int INF = 0x3f3f3f3f;
const int N = 1e2;
int u1, u2, v1, v2;
inline void solve() {
  cin >> u1 >> v1 >> u2 >> v2;
  int du = u2 - u1 + 1, dv = v2 - v1 + 1;
  cout << (du - 1ll) * (dv - 1ll) + 1 << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int T = 1;
  cin >> T;
  for (int t = 1; t <= T; ++t) {
    solve();
  }
  return 0;
}
