#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    int aA = a - 1;
    int bB = b - 1;
    bool col = false;
    int maxr = max(x, aA - x);
    int maxc = max(bB - y, y);
    cout << max((maxr * b), (maxc * a)) << endl;
  }
  return 0;
}
