#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int area[4];
  while (t--) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    area[0] = a * y;
    area[1] = a * (b - y - 1);
    area[2] = b * (a - x - 1);
    area[3] = b * x;
    int* max;
    max = std::max_element(area, area + 4);
    cout << *max << endl;
  }
  return 0;
}
