#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using pii = pair<long long, long long>;
using ti = tuple<long long, long long, long long>;
using ull = unsigned long long;
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;
const long long ALP = 26;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
void solve() {
  long long a, b, x, y;
  cin >> a >> b >> x >> y;
  long long mr = max(x, a - 1 - x);
  long long mc = max(y, b - 1 - y);
  cout << max(mr * b, mc * a) << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long tc;
  cin >> tc;
  for (long long i = 1; i <= tc; ++i) solve();
  return 0;
}
