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