#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, x, y;
    cin >> a >> b >> x >> y;
    long long first = a * y;
    long long second = a * (b - y - 1);
    long long third = b * x;
    long long fourth = b * (a - x - 1);
    cout << max(max(first, second), max(third, fourth)) << '\n';
  }
  return 0;
}
