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