#include <bits/stdc++.h>
using namespace std;
long long a[5000];
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long p1 = b * c, p2 = (a - c - 1) * b, p3 = a * d,
              p4 = a * (b - d - 1);
    cout << max(max(p1, p2), max(p3, p4)) << endl;
  }
}
