#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int x, y, r, c;
    cin >> r >> c >> x >> y;
    int newr = max(r - x - 1, x);
    int newc = max(c - y - 1, y);
    cout << max(newr * c, newc * r) << endl;
  }
  return 0;
}
