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