#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  long long qwe = 1;
  cin >> qwe;
  while (qwe--) {
    long long n = 0, ans = 0, k = 0, a, b, x, y, l = 0, f = 0, m = 0;
    string s;
    cin >> a >> b >> x >> y;
    f = max({x * b, y * a, (a - x - 1) * b, (b - y - 1) * a});
    cout << f;
    cout << "\n";
  }
}
