#include <bits/stdc++.h>
using namespace std;
inline int read() {
  register char c = ' ';
  register int v = 0, x = 1;
  while ((c < '0') || (c > '9')) {
    if (c == '-') x = -1;
    c = getchar();
  }
  while ((c >= '0') && (c <= '9')) {
    v = (v << 1) + (v << 3) + (c ^ 48);
    c = getchar();
  }
  return v * x;
}
inline void write(register int x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 ^ 48);
}
int t;
int main() {
  t = read();
  while (t--) {
    register int a = read(), c = read(), b = read(), d = read();
    printf("%lld\n", 1ll * (b - a) * (d - c) + 1);
  }
  return ~~(0 - 0);
}
