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