#include <bits/stdc++.h>
using namespace std;
void pixel(vector<int> arr) {
  for (int i = 0; i < arr.size(); i = i + 4) {
    int a = arr[i], b = arr[i + 1], x = arr[i + 2] + 1, y = arr[i + 3] + 1;
    cout << max(max(x - 1, a - x) * b, max(y - 1, b - y) * a) << endl;
  }
}
int main() {
  int n;
  vector<int> arr;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    arr.push_back(a);
    arr.push_back(b);
    arr.push_back(x);
    arr.push_back(y);
  }
  pixel(arr);
  return 0;
}
