#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
void solve() {
  int a, b, x, y;
  cin >> a >> b >> x >> y;
  cout << max(x * b, max((a - x - 1) * b, max(a * y, a * (b - y - 1)))) << endl;
}
int main() {
  int T;
  cin >> T;
  for (int t = (int)(0); t < (int)(T); t++) solve();
  return 0;
}
