#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const int Inf = 1e9;
const int P = 1e9 + 7;
int t, a, b, x, y;
int main() {
  ios ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << setprecision(30);
  cin >> t;
  while (t--) {
    cin >> a >> b >> x >> y;
    cout << max({x * b, y * a, (a - x - 1) * b, (b - y - 1) * a}) << '\n';
  }
  return 0;
}
