#include <bits/stdc++.h>
using namespace std;
int t, ans, tot, pus, a, b, c, d;
int main() {
  register int i;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d%d", &a, &b, &c, &d);
    ans = a * (b - d - 1);
    ans = ((ans) > (a * d) ? (ans) : (a * d));
    ans = ((ans) > (b * (a - c - 1)) ? (ans) : (b * (a - c - 1)));
    ans = ((ans) > (b * c) ? (ans) : (b * c));
    printf("%d\n", ans);
  }
}
