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