#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  int64_t events;
  cin >> events;
  for (int j = 0; j < (events); ++j) {
    long long w, h, x, y;
    cin >> w >> h >> x >> y;
    long long m = (x)*h;
    m = max(m, w * (y));
    m = max(m, (w * h) - (y + 1) * w);
    m = max(m, w * h - (x + 1) * h);
    cout << m << endl;
  }
}
