#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 m, n, o, p;
    m = x * b;
    n = (a - x - 1) * b;
    o = a * y;
    p = a * (b - y - 1);
    int u = max(m, n);
    int v = max(o, p);
    cout << max(u, v) << endl;
  }
  return 0;
}
