#include <bits/stdc++.h>
using namespace std;
long long a[500009];
long long b[500009];
long long cc[500009];
map<long long, long long> mp;
map<long long, long long> mp1;
int main() {
  cin.sync_with_stdio(false);
  long long i, j, k, l, c, v, n, m, r, tt;
  cin >> tt;
  string s;
  while (tt--) {
    cin >> n >> m >> k >> l;
    v = max(l, (m - l - 1)) * n;
    c = max(k, (n - k - 1)) * m;
    cout << max(c, v) << endl;
  }
}
