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