#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
static inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T &x, U y) {
  if (y > x) x = y;
}
const long long int mod = 998244353;
const long long inf = (long long int)1e18 + 17;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
long long int find(int i, int j) {
  if (i == 1 && j == 1) return 1;
  long long int op = i * (i + 1) / 2;
  long long int ok = (i + j - 2) * (i + j - 1) / 2 - ((i - 1) * i / 2);
  return op + ok;
}
long long int lef(int i, int j) { return i + j - 2; }
long long int dwn(int i, int j) { return lef(i + 1, j); }
void solve() {
  long long int x1, x2, y1, y2, ans1 = 0, ans2 = 0, src;
  cin >> x1 >> y1 >> x2 >> y2;
  long long int n = y2 - y1, m = x2 - x1;
  long long int ans = (n * m) + 1;
  cout << ans << endl;
}
int main() {
  clock_t tt;
  tt = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  tt = clock() - tt;
  double time_taken = ((double)tt) / CLOCKS_PER_SEC;
  return 0;
}
