#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, maxn = 2e5 + 10;
int T, n, m, a, b, x, y;
char st[maxn];
int main(int argc, char const *argv[]) {
  scanf("%d", &T);
  for (int _ = 1; _ <= T; ++_) {
    int ans = 0;
    scanf("%d%d%d%d", &a, &b, &x, &y);
    ans = max(ans, x * b);
    ans = max(ans, (a - 1 - x) * b);
    ans = max(ans, y * a);
    ans = max(ans, (b - 1 - y) * a);
    cout << ans << endl;
    ;
  }
  return 0;
}
