#include <bits/stdc++.h>
using namespace std;
int numbits(int n) { return n ? 1 + numbits(n & (n - 1)) : 0; }
int main() {
  int t;
  cin >> t;
  for (int cs = 0; cs < t; ++cs) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    int dx1 = x;
    int dx2 = a - x - 1;
    int dy1 = y;
    int dy2 = b - y - 1;
    int res1 = max(dx1 * b, dx2 * b);
    int res2 = max(dy1 * a, dy2 * a);
    int res = max(res1, res2);
    cout << res << endl;
  }
  return 0;
}
