#include <bits/stdc++.h>
using pii = std::pair<long long, long long>;
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t, x1, y1, x2, y2;
  cin >> t;
  for (long long cases = 0; cases < t; cases++) {
    cin >> x1 >> y1 >> x2 >> y2;
    cout << (y2 - y1) * (x2 - x1) + 1 << "\n";
  }
  return 0;
}
