#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
long long int min(long long int a, long long int b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  long long int t, a, b, x, y;
  cin >> t;
  while (t--) {
    long long int k1 = 0, k2 = 0, k3 = 0, k4 = 0, k5 = 0, k6 = 0, k7 = 0, c1,
                  c2, c3, c4;
    cin >> a >> b >> x >> y;
    c1 = max(x, y);
    c2 = min(x, y);
    c3 = max(a, b);
    c4 = min(a, b);
    if (min(a, b) >= max(x, y)) {
      k1 = (a - x - 1) * b;
      k2 = x * b;
      k3 = (b - y - 1) * a;
      k4 = y * a;
      k5 = max(k1, k2);
      k6 = max(k3, k4);
      k7 = max(k5, k6);
    } else {
      k1 = (c3 - c1 - 1) * c4;
      k2 = c1 * c4;
      k3 = (c4 - c2 - 1) * c3;
      k4 = c2 * c3;
      k5 = max(k1, k2);
      k6 = max(k3, k4);
      k7 = max(k5, k6);
    }
    cout << k7;
    if (t != 0) cout << endl;
  }
  return 0;
}
