#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;
    x += 1;
    y += 1;
    int p = (max(a - x, x - 1)) * b;
    int q = (max(b - y, y - 1)) * a;
    cout << max(p, q) << endl;
  }
  return 0;
}
