#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int a, b, x, y;
    scanf("%d %d %d %d", &a, &b, &x, &y);
    ++x, ++y;
    int A = (y - 1) * a;
    int B = (x - 1) * b;
    int C = (x + 1 > a ? 0 : (abs((x + 1) - a) + 1) * b);
    int D = (y + 1 > b ? 0 : (abs((y + 1) - b) + 1) * a);
    69;
    ;
    printf("%d\n", max({A, B, C, D}));
  }
}
