#include <bits/stdc++.h>
using namespace std;
int main() {
  long long tc;
  scanf("%lld", &tc);
  while (tc--) {
    long long a, b, x, y;
    scanf("%lld%lld", &a, &b);
    scanf("%lld%lld", &x, &y);
    cout << max(max(x, a - x - 1) * b, max(y, b - y - 1) * a) << '\n';
  }
}
