#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, x, y;
    cin >> a >> b >> x >> y;
    long long distX = x - a, distY = y - b;
    cout << distX * distY + 1 << '\n';
  }
}
