#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int length, height;
    cin >> length >> height;
    int pixL, pixH;
    cin >> pixL >> pixH;
    int ans = max(max(height - pixH - 1, pixH) * length,
                  max(length - pixL - 1, pixL) * height);
    cout << ans << endl;
  }
  return 0;
}
