#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream& operator<<(ostream& o, pair<T1, T2> x) {
  return o << x.first << " " << x.second;
}
template <class T1, class T2>
istream& operator>>(istream& o, pair<T1, T2>& x) {
  return o >> x.first >> x.second;
}
template <class T1, class T2>
pair<T1, T2> operator+(pair<T1, T2> a, pair<T1, T2> b) {
  a.first += b.first;
  a.second += b.second;
  return a;
}
template <class T1, class T2>
pair<T1, T2> operator-(pair<T1, T2> a, pair<T1, T2> b) {
  a.first -= b.first;
  a.second -= b.second;
  return a;
}
template <class T1, class T2>
void operator+=(pair<T1, T2>& a, pair<T1, T2> b) {
  a.first += b.first;
  a.second += b.second;
}
template <class T1, class T2>
void operator-=(pair<T1, T2>& a, pair<T1, T2> b) {
  a.first -= b.first;
  a.second -= b.second;
}
template <long long int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template <typename... Args>
  Vec(long long int n = 0, Args... args)
      : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {}
};
template <typename T>
struct Vec<1, T> : public vector<T> {
  Vec(long long int n = 0, const T& val = T()) : vector<T>(n, val) {}
};
const long long int md = 998244353;
inline long long int add(long long int x, long long int y) {
  x += y;
  if (x >= md) x -= md;
  return x;
}
inline long long int sub(long long int x, long long int y) {
  x -= y;
  if (x < 0) x += md;
  return x;
}
inline long long int mul(long long int x, long long int y) {
  return (x * y) % md;
}
inline long long int power(long long int x, long long int y) {
  long long int res = 1;
  for (; y; y >>= 1, x = mul(x, x)) {
    if (y & 1) res = mul(res, x);
  }
  return res;
}
inline long long int inv(long long int a) { return power(a, md - 2); }
void solve() {
  long long int a, b, x, y, ans;
  cin >> a >> b >> x >> y;
  ans = max(b * max(x, a - x - 1), a * (max(y, b - y - 1)));
  cout << ans << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T;
  cin >> T;
  while (T--) {
    solve();
  }
}
