#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, res = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    res = res * 10 + c - '0', c = getchar();
  }
  return f * res;
}
long long a, b, c, d, t;
signed main() {
  t = read();
  while (t--) {
    a = read();
    b = read();
    c = read();
    d = read();
    long long x = c - a, y = d - b;
    printf("%lld\n", x * y + 1);
  }
  return 0;
}
