#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, i, x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  cout << (x2 - x1) * (y2 - y1) + 1 << '\n';
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  cin >> tt;
  while (tt--) {
    solve();
  }
  cerr << " Execution : " << (1.0 * clock()) / CLOCKS_PER_SEC << "s \n";
  return 0;
}
