#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, x, y, ans = 0;
    cin >> a >> b >> x >> y;
    ans = max(b * x, b * (a - (x + 1)));
    ans = max({ans, a * y, a * (b - (y + 1))});
    printf("%d\n", ans);
  }
}
