#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    x += 1;
    y += 1;
    cout << max(max(max((a * (b - y)), a * (y - 1)), b * (a - x)), b * (x - 1))
         << "\n";
  }
  return 0;
}
