#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-2;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;

int mp[8][8];

int main() {
	rep(i, 8) {
		rep(j, 8) {
			mp[i][j] = 1;
		}
	}
	for (int i = 0; i < 8; i += 2) {
		for(int j = 1; j < 8; j += 2) {
			mp[i][j] = 0;
		}
	}
	int q; cin >> q;
	rep(aa, q) {
		int a, b, c, d; cin >> a >> b >> c >> d; a--; b--; c--; d--;
		int ans = 0;
		Rep1(i, a, c) {
			Rep1(j, b, d) {
				ans += mp[i][j];
			}
		}
		cout << ans << endl;
	}
	//stop
	return 0;
}
