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