#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long power(long long num, long long r) {
  if (r == 0) return 1;
  if (r == 1) return num % mod;
  long long ans = power(num, r / 2) % mod;
  if (r % 2 == 0) {
    return (ans * ans) % mod;
  }
  return (((ans * ans) % mod) * num) % mod;
}
long long modinv(long long num) { return power(num, mod - 2); }
int findset(int arr[], int x) {
  if (x != arr[x]) {
    arr[x] = findset(arr, arr[x]);
  }
  return arr[x];
}
void uni(int arr[], int ranks[], int a, int b) {
  int ra = findset(arr, a);
  int rb = findset(arr, b);
  if (ra != rb) {
    if (ranks[ra] < ranks[rb]) swap(ra, rb);
    arr[rb] = ra;
    if (ranks[ra] == ranks[rb]) {
      ranks[ra]++;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T;
  cin >> T;
  int a, b, x, y;
  while (T--) {
    cin >> a >> b >> x >> y;
    cout << max(max(x, a - x - 1) * b, a * max(y, b - 1 - y)) << "\n";
  }
  return 0;
}
