#include <bits/stdc++.h>
using namespace std;
int grid[1000][1000];
set<int> s;
int pa, push_back;
void dfs(int a, int b, int sum) {
  if (a > pa or b > push_back) return;
  if (a == pa and b == push_back) {
    s.insert(sum);
    return;
  }
  dfs(a + 1, b, grid[a][b - 1] + sum);
  dfs(a, b + 1, grid[a - 1][b] + sum);
}
void solve() {
  long long x1, x2, y1, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  long long x = x2 - x1;
  long long y = y2 - y1;
  cout << x * y + 1 << '\n';
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
