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