#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
const int maxn = 1005;
long long dp[2005][2005];
bool cmp(long long a, long long b) { return a > b; }
int main() {
  long long str[27] = {0};
  long long i, j, k;
  long long n, m, pos1, pos2, a, b, x, y;
  long long t, sum1, sum2;
  cin >> t;
  while (t--) {
    long long ans = 0;
    cin >> a >> b >> x >> y;
    ans = max(a * b - a * (y + 1), a * b - a * (b - y));
    ans = max(ans, b * a - b * (x + 1));
    ans = max(ans, a * b - b * (a - x));
    cout << ans << endl;
  }
}
