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