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