#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    x++, y++;
    int ans1 = (x - 1) * b;
    ans1 = max(ans1, a * (y - 1));
    ans1 = max(ans1, (a - x) * b);
    ans1 = max(ans1, (b - y) * a);
    cout << ans1 << endl;
  }
  return 0;
}
