#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t, x1, x2, y1, y2;
  cin >> t;
  while (t--) {
    cin >> x1 >> y1 >> x2 >> y2;
    cout << (y2 - y1) * (x2 - x1) + 1 << "\n";
  }
  return 0;
}
