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