#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
using namespace std;
long long mul(long long a, long long b, long long m = 1000000007) {
  long long res = 0;
  a = a % m;
  while (b > 0) {
    if (b % 2 == 1) res = (res + a) % m;
    a = (a * 2) % m;
    b /= 2;
  }
  return res % m;
}
long long expMod(long long a, long long b, long long m = 1000000007) {
  long long x = 1, y = a;
  while (b) {
    if (b % 2 == 1) {
      x = mul(x, y, m);
    }
    y = mul(y, y, m);
    b = b / 2;
  }
  return x;
}
bool getBit(long long n, long long i) { return (n >> i) & 1; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long T, a, b, x, y;
  cin >> T;
  while (T--) {
    cin >> a >> b >> x >> y;
    long long tp = x * b;
    tp = max(tp, (a - x - 1) * b);
    tp = max(tp, y * a);
    tp = max(tp, a * (b - y - 1));
    cout << tp << "\n";
  }
  return 0;
}
