#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* na, Arg1&& arg1, Args&&... args) {
  const char* c = strchr(na + 1, ',');
  cerr.write(na, c - na) << " : " << arg1 << " , ";
  __f(c + 1, args...);
}
const int mod = 1e9 + 7;
const int inf = 1e9;
const long long INF = 1e18;
const int N = 1e5 + 5;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int tc = 1; tc <= t; tc++) {
    int r, c, x, y;
    cin >> r >> c >> x >> y;
    int mx = 0;
    if (x - 1 >= 0) {
      mx = max(mx, (x * c));
    }
    if (x + 1 < r) {
      mx = max(mx, (r - 1 - (x + 1) + 1) * c);
    }
    if (y - 1 >= 0) {
      mx = max(mx, (y * r));
    }
    if (y + 1 < c) {
      mx = max(mx, (c - 1 - (y + 1) + 1) * r);
    }
    cout << mx << "\n";
  }
  return 0;
}
