#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-18;
const double DEPS = 1e-9;
const long double PI = 3.141592653589793238;
const long long MOD = 1000000007;
const int N = (int)(5e5) + 10;
void inp() {}
void out() {}
long long gcd(long long fx, long long fy) {
  if (!fy) return fx;
  return gcd(fy, fx % fy);
}
inline void fill(int* ar, int sz, int val) {
  for (int i = 0; i < sz; i++) {
    ar[i] = val;
  }
}
long long t, x, y, a, b;
int main() {
  inp();
  cin >> t;
  while (t--) {
    cin >> x >> y >> a >> b;
    long long ans = (x - a - 1) * y;
    ans = max(ans, a * y);
    ans = max(ans, x * (y - b - 1));
    ans = max(ans, x * b);
    cout << ans << endl;
  }
}
