#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using pi = pair<int, int>;
long long gcd(long long a, long long b) {
  while (b ^= a ^= b ^= a %= b)
    ;
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const int mod = (int)1e5 + 7;
template <class T>
inline void sc(T &ret) {
  char c;
  ret = 0;
  while ((c = getchar()) < '0' || c > '9')
    ;
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + (c - '0'), c = getchar();
  }
}
long long power(long long x, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = ans * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    cout << max(max(y * a, (b - y - 1) * a), max(x * b, (a - x - 1) * b))
         << '\n';
  }
  return 0;
}
