#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;
    int first = a * (b - y - 1);
    int second = a * (y);
    int third = (a - x - 1) * b;
    int fourth = (x)*b;
    cout << max(first, max(second, max(third, fourth))) << endl;
  }
}
