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