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