#include <bits/stdc++.h>
using namespace std;
void resolve() {
  long long a, b, x, y;
  cin >> a >> b >> x >> y;
  cout << max({b * x, b * (a - x - 1), a * y, a * (b - y - 1)});
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  for (long long i = 1; i <= t; i++) {
    resolve();
    cout << '\n';
  }
}
