#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    int res = max(x * b, a * y);
    res = max(res, a * (b - y - 1));
    res = max(res, (a - x - 1) * b);
    ans.push_back(res);
  }
  for (int i : ans) cout << i << "\n";
  return 0;
}
