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