#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int z = 0; z < t; z++) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    int sum1 = (a - x - 1) * b, sum2 = (x - 0) * b, sum3 = a * (b - y - 1),
        sum4 = a * (y - 0);
    cout << max(sum1, max(sum2, max(sum3, sum4))) << endl;
  }
}
