#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x, y, xx, yy;
    cin >> x >> y >> xx >> yy;
    cout << (xx - x) * (yy - y) + 1 << '\n';
  }
}
