#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(NULL);
  int tc;
  cin >> tc;
  while (tc--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    c++;
    d++;
    long long sum = 0;
    long long x1 = a - c;
    long long x2 = a - x1 - 1;
    long long x3 = b - d;
    long long x4 = b - x3 - 1;
    sum = max(x1 * b, x2 * b);
    sum = max(sum, max(x3 * a, x4 * a));
    cout << sum << endl;
  }
  return 0;
}
