#include <bits/stdc++.h>
using namespace std;
long long up, down, r, l, t;
void Nhap() {
  cin >> t;
  while (t--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    up = 1ll * a * y;
    down = 1ll * a * (b - y - 1);
    r = 1ll * b * x;
    l = 1ll * b * (a - x - 1);
    cout << max(max(up, down), max(r, l)) << endl;
  }
}
int main() { Nhap(); }
