#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void JAISHREERAM() {
  long long int n, i, j, ans = 0;
  long long int a, b, x, y;
  cin >> a >> b >> x >> y;
  i = max(x, a - x - 1), j = max(y, b - y - 1);
  ans = max(i * b, j * a);
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int T = 1;
  cin >> T;
  for (int t = 1; t <= T; t++) {
    JAISHREERAM();
  }
  return 0;
}
