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