#include <bits/stdc++.h>
using namespace std;
void feladat() {
  int a, b, x, y;
  cin >> a >> b >> x >> y;
  int ki = (y)*a;
  ki = max(ki, (b - y - 1) * a);
  ki = max(ki, b * (x));
  ki = max(ki, b * (a - x - 1));
  cout << ki << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    feladat();
  }
}
