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