#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  int a, b, x, y;
  while (T--) {
    cin >> a >> b >> x >> y;
    cout << max({b * (a - x - 1), b * x, a * (b - y - 1), a * y}) << "\n";
  }
  return 0;
}
