#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
inline long long read() {
  long long x = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return w == 1 ? x : -x;
}
const int N = 1e5 + 10;
int a[N], n;
int main() {
  int _ = read();
  while (_--) {
    long long x1 = read(), y1 = read();
    long long x2 = read(), y2 = read();
    if (x1 == x2 || y1 == y2) {
      puts("1");
      continue;
    }
    long long ans = (x2 - x1) * (y2 - y1) + 1;
    printf("%lld\n", ans);
  }
}
