#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0.0);
const int N = 1e5 + 1;
void solve() {
  long long a, b, x, y;
  cin >> a >> b >> x >> y;
  int a1 = a - x;
  int b1 = b - y;
  int a2 = a - a1;
  int b2 = b - b1;
  cout << max(max(x * b, (a - x - 1) * b), max(y * a, (b - y - 1) * a)) << "\n";
}
int main() {
  int tc = 1;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
