#include <bits/stdc++.h>
const long long INF = (long long)1e7 + 1;
const long long mod = (long long)998244353;
const long long hell = (long long)1000000007;
using namespace std;
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y % 2) res = (x % hell * res % hell) % hell;
    x = (x % hell * x % hell) % hell;
    y = y / 2;
  }
  return res;
}
long long int modinv(long long int x) { return power(x, hell - 2); }
void solve();
void fastIO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fastIO();
  solve();
}
long long int pw(long long int k, long long int x);
long long int gcd(long long int x, long long int y);
void solve() {
  int test;
  cin >> test;
  while (test--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    x++;
    y++;
    int a1 = (x - 1) * b;
    int a2 = a * (y - 1);
    int a3 = a * (b - y);
    int a4 = (a - x) * b;
    cout << max({a1, a2, a3, a4}) << "\n";
  }
}
long long int gcd(long long int a, long long int b) {
  while (b != 0) {
    long long int t = b;
    b = a % t;
    a = t;
  }
  return a;
}
long long int pw(long long int k, long long int x) {
  if (x == 0) return 1;
  if (x & 1)
    return ((pw(k, x - 1)) * k);
  else
    return ((pw(k, x / 2)) * (pw(k, x / 2)));
}
