#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 1;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long power(long long A, long long B, long long mod = 1000000007) {
  long long r = 1;
  while (B > 0) {
    if (B & 1LL) r = (r * A) % mod;
    A = (A * A) % mod;
    B >>= 1;
  }
  return r;
}
struct set_comp {
  bool operator()(const int& lhs, const int& rhs) { return lhs < rhs; }
};
const int N = 1000002;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    int ans = max(max(y * a, x * b), max((b - 1 - y) * a, (a - 1 - x) * b));
    cout << ans << endl;
  }
  return 0;
}
