#include <bits/stdc++.h>
using namespace std;
int max(int a, int b, int c, int d) { return max(max(a, b), max(c, d)); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int ttt = 0; ttt < t; ++ttt) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    cout << max((a - x - 1) * b, x * b, (b - y - 1) * a, y * a) << endl;
  }
}
