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