#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  for (; t > 0; --t) {
    int w, h, x, y;
    cin >> w >> h >> x >> y;
    int mx = 0;
    mx = max(mx, h * x);
    mx = max(mx, h * (w - x - 1));
    mx = max(mx, w * y);
    mx = max(mx, w * (h - y - 1));
    cout << mx << '\n';
  }
}
