#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  int a, b, x, y;
  int tmp1, tmp2, tmp3, tmp4;
  cin >> T;
  while (T--) {
    cin >> a >> b >> x >> y;
    tmp1 = tmp2 = tmp3 = tmp4 = 0;
    if (x > 0) tmp1 = x * b;
    if (x < a) tmp2 = (a - x - 1) * b;
    if (y > 0) tmp3 = y * a;
    if (y < b) tmp4 = (b - y - 1) * a;
    int res = max(max(tmp1, tmp2), max(tmp3, tmp4));
    cout << res << "\n";
  }
  return 0;
}
