#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using lint = long long;
const int MOD = 1e9 + 7, mxn = 100010;
const int dr[] = {-1, 0, 1, 0};
const int dc[] = {0, -1, 0, 1};
int tc, N, a1, a2, b1, b2;
vector<vector<int>> adj;
void input() { cin >> a1 >> a2 >> b1 >> b2; }
lint solve() {
  lint dx = b1 - a1 + 1, dy = b2 - a2 + 1;
  return dx * dy - ((dx - 1) + (dy - 1));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> tc;
  while (tc--) {
    input();
    cout << solve() << '\n';
  }
  return 0;
}
