#include <bits/stdc++.h>
using namespace std;
using lli = long long;
using ld = long double;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
const int N = 1e6 + 5;
lli a, b, c, d;
void testCase() {
  cin >> a >> b >> c >> d;
  cout << abs(a - c) * abs(b - d) + 1 << '\n';
}
int main() {
  cin.tie(0)->sync_with_stdio(0), cout.tie(0);
  int tc;
  cin >> tc;
  while (tc--) testCase();
  return 0;
}
