#include <bits/stdc++.h>
using namespace std;
const bool ready = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  return true;
}();
const double PI = acos(-1);
using ll = long long;
using pii = pair<ll, ll>;
using pdd = pair<double, double>;
using vd = vector<double>;
using vb = vector<bool>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vs = vector<string>;
void solve() {
  ll x1;
  cin >> x1;
  ;
  ll y1;
  cin >> y1;
  ;
  ll x2;
  cin >> x2;
  ;
  ll y2;
  cin >> y2;
  ;
  ll xd = x2 - x1;
  ll yd = y2 - y1;
  ll mi = xd * (xd + 1) / 2;
  ll ma = (xd + yd) * (xd + yd + 1) / 2 - yd * (yd + 1) / 2;
  cout << ma - mi + 1 << endl;
}
signed main() {
  ll t;
  cin >> t;
  ;
  while (t--) solve();
}
