#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int test;
  cin >> test;
  while (test--) {
    long long int a, b, x, y;
    cin >> a >> b >> x >> y;
    long long int ans = -1;
    if (x == 0 || x == a - 1) {
      ans = max(ans, (a - 1) * b);
    }
    if (y == 0 || y == b - 1) {
      ans = max(ans, a * (b - 1));
    }
    if (x != 0) {
      ans = max(ans, (x)*b);
    }
    if (y != 0) {
      ans = max(ans, y * a);
    }
    if (y != b - 1) {
      ans = max(ans, (b - 1 - y) * a);
    }
    if (x != a - 1) {
      ans = max(ans, (a - 1 - x) * b);
    }
    cout << ans << endl;
  }
}
