#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    int mX, mY, r1, r2;
    mX = max(a - x - 1, x);
    mY = max(b - y - 1, y);
    r1 = mX * b;
    r2 = mY * a;
    cout << max(r1, r2) << endl;
  }
  return 0;
}
