#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int test, a, b, i, j, p, ans;
  cin >> test;
  while (test > 0) {
    cin >> a >> b >> i >> j;
    ans = std::max(std::max((a - i - 1) * b, (b - j - 1) * a),
                   std::max(i * b, j * a));
    cout << ans << endl;
    test--;
  }
}
