#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
const long long MOD = 1e9 + 7;
const long long INF = 0x3f3f3f3f;
long long read() {
  long long x = 0, f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - 48;
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return x * f;
}
int N, M;
void init() {}
void solve() {
  long long x1, y1, x2, y2;
  scanf("%lld%lld%lld%lld", &x1, &y1, &x2, &y2);
  printf("%lld\n", (x2 - x1) * (y2 - y1) + 1);
}
int main() {
  int T;
  T = 1;
  scanf("%d", &T);
  while (T--) {
    solve();
  }
  return 0;
}
