#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int q, n, i, j, k, t;
  long long int a[3];
  cin >> t;
  long long int area[5];
  while (t--) {
    long long int a, b, x, y;
    cin >> a >> b >> x >> y;
    area[1] = (b - y - 1) * a;
    area[2] = (y)*a;
    area[3] = (a - x - 1) * b;
    area[4] = (x)*b;
    long long int ans = -1;
    for (i = 1; i <= 4; i++) {
      ans = max(ans, area[i]);
    }
    cout << ans << '\n';
  }
  return 0;
}
