#include <bits/stdc++.h>
using namespace std;
void test() {
  int x, y, dx, dy, ans = 0;
  cin >> x >> y >> dx >> dy;
  long int rec1 = x * (dy), rec2 = x * (y - dy - 1), rec3 = y * (dx),
           rec4 = y * (x - dx - 1);
  ans = max(max(rec1, rec2), max(rec3, rec4));
  cout << ans << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    test();
  }
  return 0;
}
