#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, a, b, c, d;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    cout << (c - a) * (d - b) + 1 << endl;
  }
  return 0;
}
