#include <bits/stdc++.h>
using namespace std;
vector<long long> graph[200005];
bool visited[200005];
long long mod = 1000000007;
long long dfs(long long i) {
  visited[i] = true;
  for (long long j = 0; j < graph[i].size(); j++) {
    if (!visited[graph[i][j]]) {
      dfs(graph[i][j]);
    }
  }
}
void solve() {
  long long x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  if (x1 == x2 || y1 == y2) {
    cout << 1 << endl;
    return;
  }
  cout << (x2 - x1) * (y2 - y1) + 1 << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
