#include <bits/stdc++.h>
using namespace std;
void print(vector<int> v) {
  for (int i : v) cout << i << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, x, y;
    cin >> a >> b >> x >> y;
    long long ans = 0;
    if (a - x - 1 >= 0) ans = max(ans, (a - x - 1) * b);
    if (x >= 0) ans = max(ans, x * b);
    if (b - y - 1 >= 0) ans = max(ans, (b - y - 1) * a);
    if (y >= 0) ans = max(ans, y * a);
    cout << ans << endl;
  }
  return 0;
}
