#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int T;
  scanf("%d", &T);
  while (T--) {
    int a, b, x, y;
    scanf("%d %d %d %d", &a, &b, &x, &y);
    cout << max(b * max(x, a - x - 1), a * max(y, b - y - 1)) << endl;
  }
  return 0;
}
