#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long n = x2 - x1, m = y2 - y1;
    cout << n * m + 1 << endl;
  }
}
