#include <bits/stdc++.h>
using namespace std;
int T, R, C, r, c;
int cal() {
  int res = 0;
  res = max(res, r * C);
  res = max(res, c * R);
  res = max(res, (C - c - 1) * R);
  res = max(res, (R - r - 1) * C);
  return res;
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d %d %d %d", &R, &C, &r, &c);
    printf("%d\n", cal());
  }
}
