#include <bits/stdc++.h>
using namespace std;
int main() {
  int test_case;
  cin >> test_case;
  while (test_case--) {
    int a, b, x, y;
    vector<int> akash;
    cin >> a >> b >> x >> y;
    int temp1 = 0, temp2 = 0, temp3 = 0, temp4 = 0;
    temp1 = ((b - y) - 1) * a;
    temp2 = ((a - x) - 1) * b;
    temp3 = (y - 0) * a;
    temp4 = (x - 0) * b;
    akash.push_back(temp1);
    akash.push_back(temp2);
    akash.push_back(temp3);
    akash.push_back(temp4);
    int max = akash[0];
    for (int i = 1; i < 4; i++) {
      if (max < akash[i]) {
        max = akash[i];
      }
    }
    cout << max << endl;
    akash.clear();
  }
  return 0;
}
