#include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};

int main(){
    vector<vector<int>> pat(8, vector<int>(8, 1));
    for(int i=0; i<8; i+=2){
        for(int j=1; j<8; j+=2){
            pat[i][j]=0;
        }
    }

    int q; cin>>q;
    while(q--){
        int a, b, c, d; cin>>a>>b>>c>>d;
        a--, b--, c--, d--;
        int ans=0;
        for(int i=a; i<=c; i++){
            for(int j=b; j<=d; j++){
                ans+=pat[i][j];
            }
        }
        cout << ans << endl;
    }
}
