#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize(2)
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int main(int argc, char const *argv[]) {
  int t;
  cin >> t;
  int a, b, x, y;
  while (t--) {
    cin >> a >> b >> x >> y;
    x++, y++;
    int t1 = (x - 1) * b;
    int t2 = a * (y - 1);
    int t3 = (a - x) * b;
    int t4 = a * (b - y);
    cout << max(t1, max(t2, max(t3, t4))) << endl;
  }
  return 0;
}
