#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a > b) {
    a = a + b;
    b = a - b;
    a = a - b;
  }
  if (b % a == 0) return a;
  return gcd(b % a, a);
}
int lcm(int a, int b) { return (a / gcd(a, b)) * b; }
int prime[1000000], pcnt;
int defac[1000000][2], dcnt;
int era[1000000];
int input[1000000];
void defac_precompute(int maxnum) {
  int i, j;
  for (i = 2; i <= maxnum; i++) era[i] = i;
  pcnt = 0;
  for (i = 2; i <= maxnum; i++) {
    if (era[i] == 0) continue;
    prime[pcnt++] = i;
    j = i;
    while (j <= maxnum) {
      era[j] = 0;
      j += i;
    }
  }
}
set<int> pset;
vector<int> vals;
vector<pair<int, int>> edges;
int prdfac(int x) {
  int i, bx = x, p1 = 1, p2 = 1, cnt;
  dcnt = 0;
  for (i = 0; i < pcnt; i++) {
    if (bx % prime[i] == 0) {
      defac[dcnt][0] = prime[i];
      defac[dcnt][1] = 0;
      while (bx % prime[i] == 0) {
        bx /= prime[i];
        defac[dcnt][1]++;
      }
      dcnt++;
    }
    if (bx == 1) break;
  }
  if (bx > 1) {
    defac[dcnt][0] = bx;
    defac[dcnt][1] = 1;
    dcnt++;
  }
  cnt = 0;
  for (i = 0; i < dcnt; i++) {
    if (defac[i][1] % 2 == 1) {
      if (cnt == 0) p1 = defac[i][0];
      if (cnt == 1) p2 = defac[i][0];
      cnt++;
    }
  }
  pset.insert(p1);
  pset.insert(p2);
  vals.push_back(p1 * p2);
  edges.push_back(make_pair(p1, p2));
  return cnt;
}
tuple<long long int, long long int, long long int> extended_euclidean(
    long long int a, long long int b) {
  if (b == 0) return make_tuple(a, 1, 0);
  int g, x, y;
  tie(g, x, y) = extended_euclidean(b, a % b);
  return make_tuple(g, y, x - (a / b) * y);
}
int fac[1000000];
int invfac[1000000];
void comb_preprocess(int maxval) {
  invfac[0] = invfac[1] = fac[0] = fac[1] = 1;
  for (int i = 2; i <= maxval; i++)
    fac[i] = (long long int)fac[i - 1] * i % 998244353;
  for (int i = 2; i <= maxval; i++)
    invfac[i] = (long long int)(998244353 - (998244353 / i)) *
                invfac[998244353 % i] % 998244353;
  for (int i = 2; i <= maxval; i++)
    invfac[i] = (long long int)invfac[i - 1] *
                ((invfac[i] + 998244353) % 998244353) % 998244353;
}
int Comb(int n, int r) {
  return (long long int)fac[n] * invfac[r] % 998244353 * invfac[n - r] %
         998244353;
}
vector<int> getPi(string p) {
  int m = (int)p.size(), j = 0;
  vector<int> pi(m, 0);
  for (int i = 1; i < m; i++) {
    while (j > 0 && p[i] != p[j]) j = pi[j - 1];
    if (p[i] == p[j]) pi[i] = ++j;
  }
  return pi;
}
char str[1000200], fstr[1000200];
string fwd, bwd, fres, bres;
bool check_pel(int st, int ed) {
  int mid = (ed - st) / 2;
  for (int i = 0; i <= mid; i++) {
    if (str[st + i] != str[ed - i]) return false;
  }
  return true;
}
string common(const string& word, const string& rev) {
  vector<int> pi = getPi(rev);
  int m = word.size();
  int begin = 0, matched = 0;
  while (begin + matched < m) {
    if (word[begin + matched] == rev[matched]) {
      matched++;
      if (begin + matched == m) {
        break;
      }
    } else {
      if (matched == 0) {
        begin++;
      } else {
        begin += matched - pi[matched - 1];
        matched = pi[matched - 1];
      }
    }
  }
  return word.substr(begin, m - begin);
}
void solve(int tc) {
  int n, m, u, v, i, j, a, b, k, x, y, flg, pos, epos, ans, tans, fmx, bmx;
  scanf("%d %d %d %d", &x, &y, &a, &b);
  printf(
      "%d\n",
      ((((((x * (y - b - 1)) > (x * b)) ? (x * (y - b - 1)) : (x * b))) >
        ((((y * (x - a - 1)) > (y * a)) ? (y * (x - a - 1)) : (y * a))))
           ? ((((x * (y - b - 1)) > (x * b)) ? (x * (y - b - 1)) : (x * b)))
           : ((((y * (x - a - 1)) > (y * a)) ? (y * (x - a - 1)) : (y * a)))));
}
int main() {
  int T = 1, tc;
  scanf("%d", &T);
  for (tc = 1; tc <= T; tc++) solve(tc);
}
