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