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