#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> t;
  for (long long i = 0; i < t; i++) {
    long long a, b, x, y;
    cin >> a >> b >> x >> y;
    long long area = max((a - 1 - x) * b, (long long)0);
    area = max(area, x * b);
    area = max(area, (b - 1 - y) * a);
    area = max(area, y * a);
    cout << area << endl;
  }
  return 0;
}
