#include <bits/stdc++.h>
using namespace std;
long long denom = 1e9 + 7;
long long temp;
int main(int argc, const char* argv[]) {
  long long t;
  cin >> t;
  vector<long long> res(t, 0);
  for (long long i = (0); i < (t); i++) {
    long long a, b, x, y;
    cin >> a >> b >> x >> y;
    res[i] = max(max(x * b, b * (a - x - 1)), max(y * a, a * (b - y - 1)));
  }
  for (long long i = (0); i < (t); i++) {
    cout << res[i] << endl;
  }
  return 0;
}
