#include <bits/stdc++.h>
int solve();
int main(int argc, char* argv[]) {
  int t;
  scanf("%d", &t);
  while (t--) solve();
  return 0;
}
int solve() {
  int x_1, y_1, x_2, y_2;
  scanf("%d%d%d%d", &x_1, &y_1, &x_2, &y_2);
  long long h = x_2 - x_1;
  long long w = y_2 - y_1;
  long long s = h * w + 1;
  printf("%lld\n", s);
  return 0;
}
