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