#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int a, b, x, y, m, aa, bb;
    cin >> a >> b >> x >> y;
    cout << max(max(b * x, b * (a - x - 1)), max(a * y, a * (b - y - 1)))
         << endl;
  }
  return 0;
}
