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