#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
typedef pair<ll,ll> ipair;
#define F first
#define S second

int p,q,f;

int path(int a, int b, int x, int y){

    if(x==p || y==q ){
        return 1;
    }

    else{
        if(a==x-1 && b==y-1){
                if(b==y-1)
            f=1;
            return 2;
        }
        else{
            if(x-a==1)
                if(f==0)
                return path(a,b,x-1,y-1) + x-a;
            else
                return path(a,b,x-1,y-1) + x-a;
            else{
                    if(f==0)
                return path(a,b,x-1,y-1) + y-b+1;
            else
                return path(a,b,x-1,y-1) + x-a+1;
            }

        }
    }
}
void solve(){
    ll a,b,x,y;
    cin>>a>>b>>x>>y;
    p=a, q=b;f=0;
    cout<<path(a,b,x,y)<<endl;
}

int main() {
	ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);

    ll t;
    cin>>t;
    while(t--)
    {
        solve();
    }

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
typedef pair<ll,ll> ipair;
#define F first
#define S second

int p,q,r,s;

int path(int a, int b, int x, int y){

    if(x==p || y==q ){
        return 1;
    }

    else{
        if(a==x-1 && b==y-1)
            return 2;
        else{
            if(r-p==1)
                return path(a,b,x-1,y-1) + y-b;
            else
                return path(a,b,x-1,y-1) + y-b+1;

        }
    }
}
void solve(){
    ll a,b,x,y;
    cin>>a>>b>>x>>y;
    p=a, q=b; r=x,s=y;
    cout<<path(a,b,x,y)<<endl;
}

int main() {
	ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);

    ll t;
    cin>>t;
    while(t--)
    {
        solve();
    }

	return 0;
}


#include <iostream>
using namespace std;
int main(){
    int t;
    cin>> t;
    while(t--){
        int x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        cout<<(x2-x1)*(y2-y1)+1<<endl;
    }

}


#include <iostream>

using namespace std;

int main() {
    int t;
    cin >> t;
    while (q--) {
        long long a, b, c, d;
        cin >> a >> b >> c >> d;
        cout << (c - a) * (d - b) + 1 << '\n';
    }
}


/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Tuesday, June 30th 2020, 11:31:24 am
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   Always give 100% — unless you’re donating blood.
 */

#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<VI> VVI;
typedef pair<int,PI> PIP;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define loop(it,x) for(auto it=x.begin();it!=x.end();it++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define CP(dst,src) memcpy(dst, src, sizeof(src));
#define SZ(x) ((ll)(x).size())
#define watch(x) cout << (#x) << " is " << (x) << endl
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll bin(ll n, ll k)
{
    ll res = 1;

    // Since C(n, k) = C(n, n-k)
    if (k > n - k)
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        c-=a;
        d-=b;
        ll x=c+1,y=d+1;
        x-=2,y-=2;
        ll fuck=0;
        // if(x>0 && y>0) fuck=min(x,y)*min(x,y);
        // cout<<bin(c+d-2,c-1)/bin(a+b-2,a-1)<<'\n';
        cout<<bin(c+d,min(c,d))/2;//-2LL*(fuck)<<'\n';
    }

    return 0;
}


/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Monday, June 29th 2020, 9:26:09 pm
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   Always give 100% — unless you’re donating blood.
 */

#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<VI> VVI;
typedef pair<int,PI> PIP;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define loop(it,x) for(auto it=x.begin();it!=x.end();it++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define CP(dst,src) memcpy(dst, src, sizeof(src));
#define SZ(x) ((ll)(x).size())
#define watch(x) cout << (#x) << " is " << (x) << endl
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll bin(ll n, ll k)
{
    ll res = 1;

    // Since C(n, k) = C(n, n-k)
    if (k > n - k)
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        c-=a;
        d-=b;
        ll x=c+1,y=d+1;
        x-=2,y-=2;
        ll fuck=0;
        if(x>0 && y>0 && x==y) fuck=x*y;
        // cout<<bin(c+d-2,c-1)/bin(a+b-2,a-1)<<'\n';
        cout<<bin(c+d,min(c,d))-(fuck)<<'\n';
    }

    return 0;
}


/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Monday, June 29th 2020, 8:56:15 pm
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   Always give 100% — unless you’re donating blood.
 */

#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<VI> VVI;
typedef pair<int,PI> PIP;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define loop(it,x) for(auto it=x.begin();it!=x.end();it++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define CP(dst,src) memcpy(dst, src, sizeof(src));
#define SZ(x) ((ll)(x).size())
#define watch(x) cout << (#x) << " is " << (x) << endl
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll bin(ll n, ll k)
{
    ll res = 1;

    // Since C(n, k) = C(n, n-k)
    if (k > n - k)
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (ll i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        c-=a;
        d-=b;
        cout<<bin(c+d,min(c,d))<<'\n';
    }

    return 0;
}


/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Monday, June 29th 2020, 9:17:27 pm
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   Always give 100% — unless you’re donating blood.
 */

#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<VI> VVI;
typedef pair<int,PI> PIP;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define loop(it,x) for(auto it=x.begin();it!=x.end();it++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define CP(dst,src) memcpy(dst, src, sizeof(src));
#define SZ(x) ((ll)(x).size())
#define watch(x) cout << (#x) << " is " << (x) << endl
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll bin(ll n, ll k)
{
    ll res = 1;

    // Since C(n, k) = C(n, n-k)
    if (k > n - k)
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        c-=a;
        d-=b;
        ll x=c+1,y=d+1;
        x-=2,y-=2;
        ll fuck=0;
        if(x>0 && y>0) fuck=x*y;
        // cout<<bin(c+d-2,c-1)/bin(a+b-2,a-1)<<'\n';
        cout<<bin(c+d,min(c,d))-(2LL*fuck)<<'\n';
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    std::ios_base::sync_with_stdio(false);
    cin.tie(0);
	int t;
	cin >> t;
	while (t--) {
		int x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		long long r = x2 - x1;
		long long d = y2 - y1;
		cout << r * d + 1 << "\n";
	}
}


/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Tuesday, June 30th 2020, 11:18:11 am
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   Always give 100% — unless you’re donating blood.
 */

#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<VI> VVI;
typedef pair<int,PI> PIP;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define loop(it,x) for(auto it=x.begin();it!=x.end();it++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define CP(dst,src) memcpy(dst, src, sizeof(src));
#define SZ(x) ((ll)(x).size())
#define watch(x) cout << (#x) << " is " << (x) << endl
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll bin(ll n, ll k)
{
    ll res = 1;

    // Since C(n, k) = C(n, n-k)
    if (k > n - k)
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        c-=a;
        d-=b;
        ll x=c+1,y=d+1;
        x-=2,y-=2;
        ll fuck=0;
        if(x>0 && y>0) fuck=min(x,y)*min(x,y);
        // cout<<bin(c+d-2,c-1)/bin(a+b-2,a-1)<<'\n';
        cout<<bin(c+d,min(c,d))-2LL*(fuck)<<'\n';
    }

    return 0;
}


/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Monday, June 29th 2020, 9:18:40 pm
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   Always give 100% — unless you’re donating blood.
 */

#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<VI> VVI;
typedef pair<int,PI> PIP;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define loop(it,x) for(auto it=x.begin();it!=x.end();it++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define CP(dst,src) memcpy(dst, src, sizeof(src));
#define SZ(x) ((ll)(x).size())
#define watch(x) cout << (#x) << " is " << (x) << endl
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll bin(ll n, ll k)
{
    ll res = 1;

    // Since C(n, k) = C(n, n-k)
    if (k > n - k)
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        c-=a;
        d-=b;
        ll x=c+1,y=d+1;
        x-=2,y-=2;
        ll fuck=0;
        if(x>0 && y>0) fuck=x*y;
        // cout<<bin(c+d-2,c-1)/bin(a+b-2,a-1)<<'\n';
        cout<<bin(c+d,min(c,d))-(fuck)<<'\n';
    }

    return 0;
}


/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Monday, June 29th 2020, 9:29:29 pm
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   Always give 100% — unless you’re donating blood.
 */

#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<VI> VVI;
typedef pair<int,PI> PIP;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define loop(it,x) for(auto it=x.begin();it!=x.end();it++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define CP(dst,src) memcpy(dst, src, sizeof(src));
#define SZ(x) ((ll)(x).size())
#define watch(x) cout << (#x) << " is " << (x) << endl
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll bin(ll n, ll k)
{
    ll res = 1;

    // Since C(n, k) = C(n, n-k)
    if (k > n - k)
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        c-=a;
        d-=b;
        ll x=c+1,y=d+1;
        x-=2,y-=2;
        ll fuck=0;
        if(x>0 && y>0) fuck=min(x,y)*min(x,y);
        // cout<<bin(c+d-2,c-1)/bin(a+b-2,a-1)<<'\n';
        cout<<bin(c+d,min(c,d))-(fuck)<<'\n';
    }

    return 0;
}


/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Monday, June 29th 2020, 8:56:15 pm
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   Always give 100% — unless you’re donating blood.
 */

#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<VI> VVI;
typedef pair<int,PI> PIP;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define loop(it,x) for(auto it=x.begin();it!=x.end();it++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define CP(dst,src) memcpy(dst, src, sizeof(src));
#define SZ(x) ((ll)(x).size())
#define watch(x) cout << (#x) << " is " << (x) << endl
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll bin(ll n, ll k)
{
    ll res = 1;

    // Since C(n, k) = C(n, n-k)
    if (k > n - k)
        k = n - k;

    // Calculate value of
    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        c-=a;
        d-=b;
        cout<<bin(c+d,min(c,d))<<'\n';
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=1e5+5;
long long C(int n, int m){
	long long ans = 1;
	if(m < n-m) m = n-m;
	for(int i = m+1; i <= n; i++) ans *= i;
	for(int j = 1; j <= n - m; j++) ans /= j;
	return ans;
}
int X(int m,int n){
	if(m == 0 && n == 0)
		return 0;
	if(m == 0 || n == 0)
		return 1;
	return X(m-1,n)+X(m,n-1);
}
signed main(){
	int T;cin>>T;
	while(T--){
		int x1,y1,x2,y2;
		cin>>x1>>y1>>x2>>y2;
		int r=x2-x1;
		int l=y2-y1;
		if(r==0&&l==0){cout<<"1"<<endl;continue;}
		cout<<X(l,r)<<endl;
	}
}
/*
1  2  4  7  11 16
3  5  8  12 17
6  9  13 18
10 14 19
15 20
21
*/


#include<bits/stdc++.h>
#define ll long long
#define LL long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int MOD=inf;
const int maxn=1e5+5;
map <int, LL> m;

//·Ö½âÖÊÒòÊý
//kÎª1»ò-1
void fun(int n, int k)
{
    for (int i = 2; i <= sqrt(n * 1.0); i++)
    {
        while (n % i == 0)
        {
            n /= i;
            m[i] += k;
        }
    }
    if (n > 1)
    {
        m[n] += k;
    }
}

//´óÊý¿ìËÙÃÝÈ¡Ä£
LL quick_pow(LL a, LL b)
{
    LL ret = 1;
    while (b)
    {
        if (b & 1)
        {
            ret *= a;
         //   ret %= MOD;
        }
        b >>= 1;
        a *= a;
    //    a %= MOD;
    }
    return ret;
}

//Çó×éºÏÊý
LL C(LL a, LL b)
{
    if (a < b || a < 0 || b < 0)
        return 0;
    m.clear();
    LL ret = 1;
    b = min(a - b, b);
    for (int i = 0; i < b; i++)
    {
        fun(a - i, 1);
    }
    for (int i = b; i >= 1; i--)
    {
        fun(i, -1);
    }

    ///ÒÔÏÂ¼ÆËã³öÁË¾ßÌåµÄÊý
    for (__typeof(m.begin()) it = m.begin(); it != m.end(); it++)
    {
        if ((*it).second != 0)
        {
            ret *= quick_pow((*it).first, (*it).second);
          //  ret %= MOD;
        }
    }
    return ret;
}
signed main(){
	IO;
	int T;cin>>T;
	while(T--){
		int x1,y1,x2,y2;
		cin>>x1>>y1>>x2>>y2;
		int r=x2-x1;
		int l=y2-y1;
		if(r==0&&l==0){cout<<"1"<<endl;continue;}
		//cout<<C(l+r,r)<<endl;
		cout<<r*l+1<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long
#define LL long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int MOD=inf;
const int maxn=1e5+5;
map <int, LL> m;

//·Ö½âÖÊÒòÊý
//kÎª1»ò-1
void fun(int n, int k)
{
    for (int i = 2; i <= sqrt(n * 1.0); i++)
    {
        while (n % i == 0)
        {
            n /= i;
            m[i] += k;
        }
    }
    if (n > 1)
    {
        m[n] += k;
    }
}

//´óÊý¿ìËÙÃÝÈ¡Ä£
LL quick_pow(LL a, LL b)
{
    LL ret = 1;
    while (b)
    {
        if (b & 1)
        {
            ret *= a;
            ret %= MOD;
        }
        b >>= 1;
        a *= a;
        a %= MOD;
    }
    return ret;
}

//Çó×éºÏÊý
LL C(LL a, LL b)
{
    if (a < b || a < 0 || b < 0)
        return 0;
    m.clear();
    LL ret = 1;
    b = min(a - b, b);
    for (int i = 0; i < b; i++)
    {
        fun(a - i, 1);
    }
    for (int i = b; i >= 1; i--)
    {
        fun(i, -1);
    }

    ///ÒÔÏÂ¼ÆËã³öÁË¾ßÌåµÄÊý
    for (__typeof(m.begin()) it = m.begin(); it != m.end(); it++)
    {
        if ((*it).second != 0)
        {
            ret *= quick_pow((*it).first, (*it).second);
            ret %= MOD;
        }
    }
    return ret;
}
signed main(){
	IO;
	int T;cin>>T;
	while(T--){
		int x1,y1,x2,y2;
		cin>>x1>>y1>>x2>>y2;
		int r=x2-x1;
		int l=y2-y1;
		if(r==0&&l==0){cout<<"1"<<endl;continue;}
		cout<<C(l+r,r)<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=1e5+5;
long long C(int n, int m){
	long long ans = 1;
	if(m < n-m) m = n-m;
	for(int i = m+1; i <= n; i++) ans *= i;
	for(int j = 1; j <= n - m; j++) ans /= j;
	return ans;
}
int X(int m,int n){
	if(m == 0 && n == 0)
		return 0;
	if(m == 0 || n == 0)
		return 1;
	return X(m-1,n)+X(m,n-1);
}
int main(){
	int T;cin>>T;
	while(T--){
		int x1,y1,x2,y2;
		cin>>x1>>y1>>x2>>y2;
		int r=x2-x1;
		int l=y2-y1;
		if(r==0&&l==0){cout<<"1"<<endl;continue;}
		cout<<C(l+r,r)<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long
#define LL long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int MOD=inf;
const int maxn=1e5+5;
map <int, LL> m;

//·Ö½âÖÊÒòÊý
//kÎª1»ò-1
void fun(int n, int k)
{
    for (int i = 2; i <= sqrt(n * 1.0); i++)
    {
        while (n % i == 0)
        {
            n /= i;
            m[i] += k;
        }
    }
    if (n > 1)
    {
        m[n] += k;
    }
}

//´óÊý¿ìËÙÃÝÈ¡Ä£
LL quick_pow(LL a, LL b)
{
    LL ret = 1;
    while (b)
    {
        if (b & 1)
        {
            ret *= a;
         //   ret %= MOD;
        }
        b >>= 1;
        a *= a;
    //    a %= MOD;
    }
    return ret;
}

//Çó×éºÏÊý
LL C(LL a, LL b)
{
    if (a < b || a < 0 || b < 0)
        return 0;
    m.clear();
    LL ret = 1;
    b = min(a - b, b);
    for (int i = 0; i < b; i++)
    {
        fun(a - i, 1);
    }
    for (int i = b; i >= 1; i--)
    {
        fun(i, -1);
    }

    ///ÒÔÏÂ¼ÆËã³öÁË¾ßÌåµÄÊý
    for (__typeof(m.begin()) it = m.begin(); it != m.end(); it++)
    {
        if ((*it).second != 0)
        {
            ret *= quick_pow((*it).first, (*it).second);
          //  ret %= MOD;
        }
    }
    return ret;
}
signed main(){
	IO;
	int T;cin>>T;
	while(T--){
		int x1,y1,x2,y2;
		cin>>x1>>y1>>x2>>y2;
		int r=x2-x1;
		int l=y2-y1;
		if(r==0&&l==0){cout<<"1"<<endl;continue;}
		cout<<C(l+r,r)<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=1e5+5;
long long C(int n, int m){
	long long ans = 1;
	if(m < n-m) m = n-m;
	for(int i = m+1; i <= n; i++) ans *= i;
	for(int j = 1; j <= n - m; j++) ans /= j;
	return ans;
}
int X(int m,int n){
	if(m == 0 && n == 0)
		return 0;
	if(m == 0 || n == 0)
		return 1;
	return X(m-1,n)+X(m,n-1);
}
int main(){
	int T;cin>>T;
	while(T--){
		int x1,y1,x2,y2;
		cin>>x1>>y1>>x2>>y2;
		int r=x2-x1;
		int l=y2-y1;
		if(r==0&&l==0){cout<<"1"<<endl;continue;}
		cout<<X(l,r)<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=1e5+5;
long long C(int n, int m){
	long long ans = 1;
	if(m < n-m) m = n-m;
	for(int i = m+1; i <= n; i++) ans *= i;
	for(int j = 1; j <= n - m; j++) ans /= j;
	return ans;
}
int X(int m,int n){
	if(m == 0 && n == 0)
		return 0;
	if(m == 0 || n == 0)
		return 1;
	return X(m-1,n)+X(m,n-1);
}
signed main(){
	int T;cin>>T;
	while(T--){
		int x1,y1,x2,y2;
		cin>>x1>>y1>>x2>>y2;
		int r=x2-x1;
		int l=y2-y1;
		if(r==0&&l==0){cout<<"1"<<endl;continue;}
		cout<<C(l+r,r)<<endl;
	}
}
/*
1  2  4  7  11 16
3  5  8  12 17
6  9  13 18
10 14 19
15 20
21
*/


#include<bits/stdc++.h>

using namespace std;

inline long long quadratic(long long n, long long s, long long d, long long c){
    if(n*(c*n*n+2*c+3*n*d+6*s-3*c*n-3*d)%6){
        cout << "ERRRRORR";
    }
    return n*(c*n*n+2*c+3*n*d+6*s-3*c*n-3*d)/6;
}

inline long long sum(long long i){
    return i*(i+1)/2;
}

inline long long sum(long long i, long long j){
    return sum(j)-sum(i-1);
}

inline long long summ(long long i, long long j){
    return quadratic(j-i+1,i,i,1);
}

inline long long value(long long i, long long j){
    return sum(i+j-2)+j;
}

inline long long where(long long i, long long j){
    return i+j-1;
}

inline long long vizsz(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(x2-x1) << '\n';
    //cout << summ(where(x1,y1),where(x2,y1)-1) << '\n';
    return (value(x1,y1)-where(x1,y1))*(x2-x1)+
           max(summ(where(x1,y1),where(x2,y1)-1),0LL)
    ;

}
inline long long fugg(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(y2-y1) << '\n';
    //cout << summ(where(x1,y1),where(x1,y2)-1) << '\n';
    return (value(x1,y1)-where(x1,y1))*(y2-y1)+
           max(summ(where(x1,y1),where(x1,y2)-1),0LL)
    ;
}

int main(){
    int t;
    cin >> t;
    while(t--){
        long long x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        cout << fugg(x1,y1,x1,y2) + vizsz(x1,y2,x2,y2) - vizsz(x1,y1,x2,y1) - fugg(x2,y1,x2,y2) + 1 << '\n';
        /*getchar();
        cout << fugg(x1,y1,x1,y2);
        getchar();
        cout << fugg(x2,y1,x2,y2);
        getchar();
        cout << vizsz(x1,y1,x2,y1);
        getchar();
        cout << vizsz(x1,y2,x2,y2);
        getchar();
        /*cout << "x1 y1 -> x2 y1 " << sum(where(x1,y1),where(x2,y1)-2) << "+" << value(x1,y1)*(x2-x1-1) << '+' << value(x1,y1) << '\n';
        cout << "x1 y1 -> x1 y2 " << where(x1,y1) << ' ' << where(x2,y1) << ' ' << sum(where(x1,y1)+1,where(x2,y1)-1) << "+" << value(x1,y1)*(y2-y1-1) << '+' << value(x1,y1) << '\n';
        cout << "x2 y1 -> x2 y2 " << sum(where(x2,y1)+1,where(x2,y2)-1) << "+" << value(x2,y1)*(y2-y1-1) << '+' << value(x2,y1) << '\n';
        cout << "x1 y2 -> x2 y2 " << sum(where(x1,y2),where(x2,y2)-2) << "+" << value(x1,y2)*(x2-x1-1) << '+' << value(x1,y2) << '\n';
        cout << (sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)*(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2))-(sum(where(x1,y1),where(x2,y1)-2)+value(x1,y1)*(x2-x1-1)+value(x1,y1)+sum(where(x2,y1)+1,where(x2,y2)-1)+value(x2,y1)*(y2-y1-1)+value(x2,y1))+1 << '\n';
        /*cout <<sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2) << '\n';*/
        /*cout << "x1 y1 -> x1 y2 -> x2 y2 " << sum(where(x1,y1)+1,where(x2,y1))+value(x1,y1)*(y2-y1)+sum(where(x1,y2),where(x2,y2)-1)+value(x1,y2)*(x2-x1) << '\n';
        cout << "x1 y1 -> x2 y1 -> x2 y2 " << sum(where(x1,y1),where(x2,y1)-1)+value(x1,y1)*(x2-x1)+sum(where(x2,y1)+1,where(x2,y2))+value(x2,y1)*(y2-y1) << '\n';
        /*cout <<
        (sum(where(x1,y1),where(x2,y1)-1)+sum(where(x2,y1)+1,where(x2,y2)))-
        (sum(where(x1,y2),where(x2,y2)-1)+sum(where(x1,y1)+1,where(x1,y2)))
        << '\n';*/
    }
return 0;
}


#include<bits/stdc++.h>

using namespace std;

inline long long sum(long long i){
    return i*(i+1)/2;
}

inline long long sum(long long i, long long j){
    return sum(j)-sum(i-1);
}

inline long long value(long long i, long long j){
    return sum(i+j-2)+j;
}

inline long long where(long long i, long long j){
    return i+j-1;
}

inline long long vizsz(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(x2-x1) << '\n';
    //cout << sum(where(x1,y1),where(x1,y2)-2) << '\n';
    return value(x1,y1)*(x2-x1)+
           max(sum(where(x1,y1)+1,where(x1,y2)-2),0LL)
    ;

}
inline long long fugg(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(y2-y1) << '\n';
    //cout << sum(where(x1,y1)+1,where(x1,y2)-1) << '\n';
    return value(x1,y1)*(y2-y1)+
           max(sum(where(x1,y1)+1,where(x1,y2)-1),0LL)
    ;
}

int main(){
    int t;
    cin >> t;
    while(t--){
        long long x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        cout << fugg(x1,y1,x1,y2) + vizsz(x1,y2,x2,y2) -
                vizsz(x1,y1,x2,y1) - fugg(x2,y1,x2,y2) + 1 << '\n';
        /*getchar();
        cout << fugg(x1,y1,x1,y2);
        getchar();
        cout << fugg(x2,y1,x2,y2);
        getchar();
        cout << vizsz(x1,y1,x2,y1);
        getchar();
        cout << vizsz(x1,y2,x2,y2);
        getchar();
        /*cout << "x1 y1 -> x2 y1 " << sum(where(x1,y1),where(x2,y1)-2) << "+" << value(x1,y1)*(x2-x1-1) << '+' << value(x1,y1) << '\n';
        cout << "x1 y1 -> x1 y2 " << where(x1,y1) << ' ' << where(x2,y1) << ' ' << sum(where(x1,y1)+1,where(x2,y1)-1) << "+" << value(x1,y1)*(y2-y1-1) << '+' << value(x1,y1) << '\n';
        cout << "x2 y1 -> x2 y2 " << sum(where(x2,y1)+1,where(x2,y2)-1) << "+" << value(x2,y1)*(y2-y1-1) << '+' << value(x2,y1) << '\n';
        cout << "x1 y2 -> x2 y2 " << sum(where(x1,y2),where(x2,y2)-2) << "+" << value(x1,y2)*(x2-x1-1) << '+' << value(x1,y2) << '\n';
        cout << (sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)*(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2))-(sum(where(x1,y1),where(x2,y1)-2)+value(x1,y1)*(x2-x1-1)+value(x1,y1)+sum(where(x2,y1)+1,where(x2,y2)-1)+value(x2,y1)*(y2-y1-1)+value(x2,y1))+1 << '\n';
        /*cout <<sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2) << '\n';*/
        /*cout << "x1 y1 -> x1 y2 -> x2 y2 " << sum(where(x1,y1)+1,where(x2,y1))+value(x1,y1)*(y2-y1)+sum(where(x1,y2),where(x2,y2)-1)+value(x1,y2)*(x2-x1) << '\n';
        cout << "x1 y1 -> x2 y1 -> x2 y2 " << sum(where(x1,y1),where(x2,y1)-1)+value(x1,y1)*(x2-x1)+sum(where(x2,y1)+1,where(x2,y2))+value(x2,y1)*(y2-y1) << '\n';
        /*cout <<
        (sum(where(x1,y1),where(x2,y1)-1)+sum(where(x2,y1)+1,where(x2,y2)))-
        (sum(where(x1,y2),where(x2,y2)-1)+sum(where(x1,y1)+1,where(x1,y2)))
        << '\n';*/
    }
return 0;
}


#include<bits/stdc++.h>

using namespace std;

inline __int128 quadratic(__int128 n, __int128 s, __int128 d, __int128 c){
    if(n*(c*n*n+2*c+3*n*d+6*s-3*c*n-3*d)%6){
        cout << "ERRRRORR";
    }
    return n*(c*n*n+2*c+3*n*d+6*s-3*c*n-3*d)/6;
}

inline __int128 sum(__int128 i){
    return i*(i+1)/2;
}

inline __int128 sum(__int128 i, __int128 j){
    return sum(j)-sum(i-1);
}

inline __int128 summ(__int128 i, __int128 j){
    return quadratic(j-i+1,i,i,1);
}

inline __int128 value(__int128 i, __int128 j){
    return sum(i+j-2)+j;
}

inline __int128 where(__int128 i, __int128 j){
    return i+j-1;
}

inline __int128 vizsz(__int128 x1, __int128 y1, __int128 x2, __int128 y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(x2-x1) << '\n';
    //cout << summ(where(x1,y1),where(x2,y1)-1) << '\n';
    return (value(x1,y1)-where(x1,y1))*(x2-x1)+
           max(summ(where(x1,y1),where(x2,y1)-1),(__int128)0)
    ;

}
inline __int128 fugg(__int128 x1, __int128 y1, __int128 x2, __int128 y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(y2-y1) << '\n';
    //cout << summ(where(x1,y1),where(x1,y2)-1) << '\n';
    return (value(x1,y1)-where(x1,y1))*(y2-y1)+
           max(summ(where(x1,y1),where(x1,y2)-1),(__int128)0)
    ;
}

int main(){
    int t;
    cin >> t;
    while(t--){
        __int128 x1, y1, x2, y2;
	long long xx1, yy1, xx2, yy2;
        cin >> xx1 >> yy1 >> xx2 >> yy2;
	x1=xx1;y1=yy1;x2=xx2;y2=yy2;
		__int128 i128 = fugg(x1,y1,x1,y2) + vizsz(x1,y2,x2,y2) - vizsz(x1,y1,x2,y1) - fugg(x2,y1,x2,y2) + 1;
		string str = "";
		while(i128>0){
			str+='0'+i128%10;
			i128/=10;
		}
		reverse(str.begin(),str.end());
		if(str.size() == 0) {
			str="0";
		}
        cout << str << '\n';
        /*getchar();
        cout << fugg(x1,y1,x1,y2);
        getchar();
        cout << fugg(x2,y1,x2,y2);
        getchar();
        cout << vizsz(x1,y1,x2,y1);
        getchar();
        cout << vizsz(x1,y2,x2,y2);
        getchar();
        /*cout << "x1 y1 -> x2 y1 " << sum(where(x1,y1),where(x2,y1)-2) << "+" << value(x1,y1)*(x2-x1-1) << '+' << value(x1,y1) << '\n';
        cout << "x1 y1 -> x1 y2 " << where(x1,y1) << ' ' << where(x2,y1) << ' ' << sum(where(x1,y1)+1,where(x2,y1)-1) << "+" << value(x1,y1)*(y2-y1-1) << '+' << value(x1,y1) << '\n';
        cout << "x2 y1 -> x2 y2 " << sum(where(x2,y1)+1,where(x2,y2)-1) << "+" << value(x2,y1)*(y2-y1-1) << '+' << value(x2,y1) << '\n';
        cout << "x1 y2 -> x2 y2 " << sum(where(x1,y2),where(x2,y2)-2) << "+" << value(x1,y2)*(x2-x1-1) << '+' << value(x1,y2) << '\n';
        cout << (sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)*(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2))-(sum(where(x1,y1),where(x2,y1)-2)+value(x1,y1)*(x2-x1-1)+value(x1,y1)+sum(where(x2,y1)+1,where(x2,y2)-1)+value(x2,y1)*(y2-y1-1)+value(x2,y1))+1 << '\n';
        /*cout <<sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2) << '\n';*/
        /*cout << "x1 y1 -> x1 y2 -> x2 y2 " << sum(where(x1,y1)+1,where(x2,y1))+value(x1,y1)*(y2-y1)+sum(where(x1,y2),where(x2,y2)-1)+value(x1,y2)*(x2-x1) << '\n';
        cout << "x1 y1 -> x2 y1 -> x2 y2 " << sum(where(x1,y1),where(x2,y1)-1)+value(x1,y1)*(x2-x1)+sum(where(x2,y1)+1,where(x2,y2))+value(x2,y1)*(y2-y1) << '\n';
        /*cout <<
        (sum(where(x1,y1),where(x2,y1)-1)+sum(where(x2,y1)+1,where(x2,y2)))-
        (sum(where(x1,y2),where(x2,y2)-1)+sum(where(x1,y1)+1,where(x1,y2)))
        << '\n';*/
    }
return 0;
}


#include<bits/stdc++.h>

using namespace std;

inline long long quadratic(long long n, long long s, long long d, long long c){
    return n*(c*n*n+2*c+3*n*d+6*s-3*c*n-3*d)/6;
}

inline long long sum(long long i){
    return i*(i+1)/2;
}

inline long long sum(long long i, long long j){
    return sum(j)-sum(i-1);
}

inline long long summ(long long i, long long j){
    return quadratic(j-i+1,i,i,1);
}

inline long long value(long long i, long long j){
    return sum(i+j-2)+j;
}

inline long long where(long long i, long long j){
    return i+j-1;
}

inline long long vizsz(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(x2-x1) << '\n';
    //cout << sum(where(x1,y1)+1,where(x1,y2)-1) << '\n';
    return value(x1,y1)*(x2-x1)+
           max(summ(where(x1,y1),where(x2,y1)-2),0LL)
    ;

}
inline long long fugg(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(y2-y1) << '\n';
    //cout << sum(where(x1,y1)+1,where(x1,y2)-1) << '\n';
    return value(x1,y1)*(y2-y1)+
           max(summ(where(x1,y1)+1,where(x1,y2)-1),0LL)
    ;
}

int main(){
    int t;
    cin >> t;
    while(t--){
        long long x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        cout << fugg(x1,y1,x1,y2) + vizsz(x1,y2,x2,y2) - vizsz(x1,y1,x2,y1) - fugg(x2,y1,x2,y2) + 1 << '\n';
        /*getchar();
        cout << fugg(x1,y1,x1,y2);
        getchar();
        cout << fugg(x2,y1,x2,y2);
        getchar();
        cout << vizsz(x1,y1,x2,y1);
        getchar();
        cout << vizsz(x1,y2,x2,y2);
        getchar();
        /*cout << "x1 y1 -> x2 y1 " << sum(where(x1,y1),where(x2,y1)-2) << "+" << value(x1,y1)*(x2-x1-1) << '+' << value(x1,y1) << '\n';
        cout << "x1 y1 -> x1 y2 " << where(x1,y1) << ' ' << where(x2,y1) << ' ' << sum(where(x1,y1)+1,where(x2,y1)-1) << "+" << value(x1,y1)*(y2-y1-1) << '+' << value(x1,y1) << '\n';
        cout << "x2 y1 -> x2 y2 " << sum(where(x2,y1)+1,where(x2,y2)-1) << "+" << value(x2,y1)*(y2-y1-1) << '+' << value(x2,y1) << '\n';
        cout << "x1 y2 -> x2 y2 " << sum(where(x1,y2),where(x2,y2)-2) << "+" << value(x1,y2)*(x2-x1-1) << '+' << value(x1,y2) << '\n';
        cout << (sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)*(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2))-(sum(where(x1,y1),where(x2,y1)-2)+value(x1,y1)*(x2-x1-1)+value(x1,y1)+sum(where(x2,y1)+1,where(x2,y2)-1)+value(x2,y1)*(y2-y1-1)+value(x2,y1))+1 << '\n';
        /*cout <<sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2) << '\n';*/
        /*cout << "x1 y1 -> x1 y2 -> x2 y2 " << sum(where(x1,y1)+1,where(x2,y1))+value(x1,y1)*(y2-y1)+sum(where(x1,y2),where(x2,y2)-1)+value(x1,y2)*(x2-x1) << '\n';
        cout << "x1 y1 -> x2 y1 -> x2 y2 " << sum(where(x1,y1),where(x2,y1)-1)+value(x1,y1)*(x2-x1)+sum(where(x2,y1)+1,where(x2,y2))+value(x2,y1)*(y2-y1) << '\n';
        /*cout <<
        (sum(where(x1,y1),where(x2,y1)-1)+sum(where(x2,y1)+1,where(x2,y2)))-
        (sum(where(x1,y2),where(x2,y2)-1)+sum(where(x1,y1)+1,where(x1,y2)))
        << '\n';*/
    }
return 0;
}


#include<bits/stdc++.h>

using namespace std;

inline long long sum(long long i){
    return i*(i+1)/2;
}

inline long long sum(long long i, long long j){
    return sum(j)-sum(i-1);
}

inline long long value(long long i, long long j){
    return sum(i+j-2)+j;
}

inline long long where(long long i, long long j){
    return i+j-1;
}

inline long long vizsz(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(x2-x1) << '\n';
    //cout << sum(where(x1,y1)+1,where(x1,y2)-1) << '\n';
    return value(x1,y1)*(x2-x1)+
           max(sum(where(x1,y1)+1,where(x1,y2)-1),0LL)
    ;

}
inline long long fugg(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(y2-y1) << '\n';
    //cout << sum(where(x1,y1)+1,where(x1,y2)-1) << '\n';
    return value(x1,y1)*(y2-y1)+
           max(sum(where(x1,y1)+1,where(x1,y2)-1),0LL)
    ;
}

int main(){
    int t;
    cin >> t;
    while(t--){
        long long x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        cout << fugg(x1,y1,x1,y2) + vizsz(x1,y2,x2,y2) -
                vizsz(x1,y1,x2,y1) - fugg(x2,y1,x2,y2) + 1 << '\n';
        /*getchar();
        cout << fugg(x1,y1,x1,y2);
        getchar();
        cout << fugg(x2,y1,x2,y2);
        getchar();
        cout << vizsz(x1,y1,x2,y1);
        getchar();
        cout << vizsz(x1,y2,x2,y2);
        getchar();
        /*cout << "x1 y1 -> x2 y1 " << sum(where(x1,y1),where(x2,y1)-2) << "+" << value(x1,y1)*(x2-x1-1) << '+' << value(x1,y1) << '\n';
        cout << "x1 y1 -> x1 y2 " << where(x1,y1) << ' ' << where(x2,y1) << ' ' << sum(where(x1,y1)+1,where(x2,y1)-1) << "+" << value(x1,y1)*(y2-y1-1) << '+' << value(x1,y1) << '\n';
        cout << "x2 y1 -> x2 y2 " << sum(where(x2,y1)+1,where(x2,y2)-1) << "+" << value(x2,y1)*(y2-y1-1) << '+' << value(x2,y1) << '\n';
        cout << "x1 y2 -> x2 y2 " << sum(where(x1,y2),where(x2,y2)-2) << "+" << value(x1,y2)*(x2-x1-1) << '+' << value(x1,y2) << '\n';
        cout << (sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)*(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2))-(sum(where(x1,y1),where(x2,y1)-2)+value(x1,y1)*(x2-x1-1)+value(x1,y1)+sum(where(x2,y1)+1,where(x2,y2)-1)+value(x2,y1)*(y2-y1-1)+value(x2,y1))+1 << '\n';
        /*cout <<sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2) << '\n';*/
        /*cout << "x1 y1 -> x1 y2 -> x2 y2 " << sum(where(x1,y1)+1,where(x2,y1))+value(x1,y1)*(y2-y1)+sum(where(x1,y2),where(x2,y2)-1)+value(x1,y2)*(x2-x1) << '\n';
        cout << "x1 y1 -> x2 y1 -> x2 y2 " << sum(where(x1,y1),where(x2,y1)-1)+value(x1,y1)*(x2-x1)+sum(where(x2,y1)+1,where(x2,y2))+value(x2,y1)*(y2-y1) << '\n';
        /*cout <<
        (sum(where(x1,y1),where(x2,y1)-1)+sum(where(x2,y1)+1,where(x2,y2)))-
        (sum(where(x1,y2),where(x2,y2)-1)+sum(where(x1,y1)+1,where(x1,y2)))
        << '\n';*/
    }
return 0;
}


#include<bits/stdc++.h>

using namespace std;

inline long long sum(long long i){
    return i*(i+1)/2;
}

inline long long sum(long long i, long long j){
    return sum(j)-sum(i-1);
}

inline long long value(long long i, long long j){
    return sum(i+j-2)+j;
}

inline long long where(long long i, long long j){
    return i+j-1;
}

inline long long vizsz(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(x2-x1) << '\n';
    //cout << sum(where(x1,y1)+1,where(x1,y2)-1) << '\n';
    return value(x1,y1)*(x2-x1)+
           max(sum(where(x1,y1),where(x2,y1)-2),0LL)
    ;

}
inline long long fugg(long long x1, long long y1, long long x2, long long y2){
    //printf("%lld %lld -> %lld %lld\n",x1,y1,x2,y2);
    //cout << value(x1,y1)*(y2-y1) << '\n';
    //cout << sum(where(x1,y1)+1,where(x1,y2)-1) << '\n';
    return value(x1,y1)*(y2-y1)+
           max(sum(where(x1,y1)+1,where(x1,y2)-1),0LL)
    ;
}

int main(){
    int t;
    cin >> t;
    while(t--){
        long long x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        cout << fugg(x1,y1,x1,y2) + vizsz(x1,y2,x2,y2) - vizsz(x1,y1,x2,y1) - fugg(x2,y1,x2,y2) + 1 << '\n';
        /*getchar();
        cout << fugg(x1,y1,x1,y2);
        getchar();
        cout << fugg(x2,y1,x2,y2);
        getchar();
        cout << vizsz(x1,y1,x2,y1);
        getchar();
        cout << vizsz(x1,y2,x2,y2);
        getchar();
        /*cout << "x1 y1 -> x2 y1 " << sum(where(x1,y1),where(x2,y1)-2) << "+" << value(x1,y1)*(x2-x1-1) << '+' << value(x1,y1) << '\n';
        cout << "x1 y1 -> x1 y2 " << where(x1,y1) << ' ' << where(x2,y1) << ' ' << sum(where(x1,y1)+1,where(x2,y1)-1) << "+" << value(x1,y1)*(y2-y1-1) << '+' << value(x1,y1) << '\n';
        cout << "x2 y1 -> x2 y2 " << sum(where(x2,y1)+1,where(x2,y2)-1) << "+" << value(x2,y1)*(y2-y1-1) << '+' << value(x2,y1) << '\n';
        cout << "x1 y2 -> x2 y2 " << sum(where(x1,y2),where(x2,y2)-2) << "+" << value(x1,y2)*(x2-x1-1) << '+' << value(x1,y2) << '\n';
        cout << (sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)*(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2))-(sum(where(x1,y1),where(x2,y1)-2)+value(x1,y1)*(x2-x1-1)+value(x1,y1)+sum(where(x2,y1)+1,where(x2,y2)-1)+value(x2,y1)*(y2-y1-1)+value(x2,y1))+1 << '\n';
        /*cout <<sum(where(x1,y1)+1,where(x2,y1)-1)+value(x1,y1)(y2-y1-1)+value(x1,y1)+sum(where(x1,y2),where(x2,y2)-2) +value(x1,y2)*(x2-x1-1)+value(x1,y2) << '\n';*/
        /*cout << "x1 y1 -> x1 y2 -> x2 y2 " << sum(where(x1,y1)+1,where(x2,y1))+value(x1,y1)*(y2-y1)+sum(where(x1,y2),where(x2,y2)-1)+value(x1,y2)*(x2-x1) << '\n';
        cout << "x1 y1 -> x2 y1 -> x2 y2 " << sum(where(x1,y1),where(x2,y1)-1)+value(x1,y1)*(x2-x1)+sum(where(x2,y1)+1,where(x2,y2))+value(x2,y1)*(y2-y1) << '\n';
        /*cout <<
        (sum(where(x1,y1),where(x2,y1)-1)+sum(where(x2,y1)+1,where(x2,y2)))-
        (sum(where(x1,y2),where(x2,y2)-1)+sum(where(x1,y1)+1,where(x1,y2)))
        << '\n';*/
    }
return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k=0;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
    if(n/2==m/2&&n>1&&m>1)
    k--;
   ll ans=1;
   for(i=n+1;i<=end;i++){

       ans=(ans*i)/(i-n);
   }
    cout<<ans-k<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
   ll ans=1;
   for(i=n+1;i<=end;i++){

       ans=(ans*i)/(i-n);
   }
    cout<<ans<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k=0;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
    if(n>1&&m>1)
    k=(m-2)*(n-2);
   ll ans=1;
   for(i=n+1;i<=end;i++){

       ans=(ans*i)/(i-n);
   }
   if(k==0)
   cout<<ans<<endl;
   else
    cout<<ans-k<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k=0;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
    if(n%2==0&&m%2==0&&n>1&&m>1&&n/2==m/2)
    k=pow(n/2,2);
   ll ans=1;
   for(i=n+1;i<=end;i++){

       ans=(ans*i)/(i-n);
   }
   if(k==0)
   cout<<ans<<endl;
   else
    cout<<ans-k+1<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k=0;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
    if(n/2==m/2&&n>1&&m>1)
    k=pow(n/2,2);
   ll ans=1;
   for(i=n+1;i<=end;i++){

       ans=(ans*i)/(i-n);
   }
   if(k==0)
   cout<<ans<<endl;
   else
    cout<<ans-k+1<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k=0;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
    if(n/2==m/2)
    k--;
   ll ans=1;
   for(i=n+1;i<=end;i++){

       ans=(ans*i)/(i-n);
   }
    cout<<ans-k<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
   ll ans=1;
cout<<n*m+1<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k=0;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
    if(n>1&&m>1)
    k=m-2+n-2;
   ll ans=1;
   for(i=n+1;i<=end;i++){

       ans=(ans*i)/(i-n);
   }
   if(k==0)
   cout<<ans<<endl;
   else
    cout<<ans-k<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int,int>
#define mk make_pair
int a[200000]={0};

void solve()
{
   ll n,q,i,k;
   ll x1,x2,y1,y2;
   cin>>x1>>y1>>x2>>y2;
   ll end=x2-x1+y2-y1;
    n=x2-x1;
   ll m=y2-y1;
   ll ans=1;
cout<<n*m+1<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	int T=1;
	cin>>T;
	while(T--)
		solve();
	return 0;


/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#pragma GCC optimize("unroll-loops", "omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

ull gcd(ull a,ull b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

void printNcR(ull n,ull r)
{
    ull p=1, k=1;

    if (n-r<r)
        r=n-r;

    if (r != 0)
    {
        while (r)
        {
            p *= n;
            k *= r;
            ull m = gcd(p,k);
            p /= m;
            k /= m;
            n--;
            r--;
        }
    }
    else
        p = 1;

    assert(p>0);
    assert(k==1);

    cout << p << endl;
}

void solve()
{
    ull x1,y1,x2,y2,a,b;
    cin >> x1 >> y1 >> x2 >> y2;

    a = x2-x1;
    b = y2-y1;

    printNcR(a+b,a);
}

int main()
{
    FIO
    sp(0);
    TC
    solve();
    return 0;
}


/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#pragma GCC optimize("unroll-loops", "omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

void printNcR(ll n,ll r)
{
    unsigned ll p = 1, k = 1;
    if (n - r < r)
        r = n - r;

    if (r != 0)
    {
        while (r)
        {
            p *= n;
            k *= r;

            unsigned ll m = __gcd(p, k);

            p /= m;
            k /= m;

            n--;
            r--;
        }
    }
    else
        p = 1;

    cout << p << endl;
}

void solve()
{
    ll x1,y1,x2,y2,a,b;
    cin >> x1 >> y1 >> x2 >> y2;

    a = x2-x1;
    b = y2-y1;

    printNcR(a+b,a);
}

int32_t main()
{
    FIO
    TC
    solve();
    return 0;
}


/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

ull gcd(ull a,ull b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

void printNcR(ull n,ull r)
{
    ull p=1, k=1;

    if (n-r<r)
        r=n-r;

    if (r != 0)
    {
        while (r)
        {
            p *= n;
            k *= r;
            ull m = gcd(p,k);
            p /= m;
            k /= m;
            n--;
            r--;
        }
    }
    else
        p = 1;

    assert(p>0);
    assert(k==1);

    cout << p << endl;
}

void solve()
{
    ull x1,y1,x2,y2,a,b;
    cin >> x1 >> y1 >> x2 >> y2;
    int64_t tmp;
    a = x2-x1;
    b = y2-y1;

    printNcR(a+b,a);
}

int main()
{

    FIO
    TC
    solve();
    return 0;
}


/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#pragma GCC optimize("unroll-loops", "omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

ull gcd(ull a,ull b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

void printNcR(ll n,ll r)
{
    ull p = 1, k = 1;
    if (n - r < r)
        r = n - r;

    if (r != 0)
    {
        while (r)
        {
            p *= n;
            k *= r;

            ull m = gcd( p, k);

            p /= m;
            k /= m;

            n--;
            r--;
        }
    }
    else
        p = 1;

    cout << p << endl;
}

void solve()
{
    ull x1,y1,x2,y2,a,b;
    cin >> x1 >> y1 >> x2 >> y2;

    a = x2-x1;
    b = y2-y1;
    printNcR(a+b,a);
}

int32_t main()
{
    FIO
    sp(0);
    TC
    solve();
    return 0;
}


/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#pragma GCC optimize("unroll-loops", "omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

ull gcd(ull a,ull b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

void printNcR(ull n,ull r)
{
    ull p = 1, k = 1;
    if (n - r < r)
        r = n - r;

    if (r != 0)
    {
        while (r)
        {
            p *= n;
            k *= r;

            ull m = gcd( p, k);

            p /= m;
            k /= m;

            n--;
            r--;
        }
    }
    else
        p = 1;

    assert(p>0);
    cout << p << endl;
}

void solve()
{
    ull x1,y1,x2,y2,a,b;
    cin >> x1 >> y1 >> x2 >> y2;

    a = x2-x1;
    b = y2-y1;
    printNcR(a+b,a);
}

int32_t main()
{
    FIO
    sp(0);
    TC
    solve();
    return 0;
}


/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#pragma GCC optimize("unroll-loops", "omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

ull gcd(ull a,ull b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

void printNcR(ll n,ll r)
{
    ld p = 1, k = 1;
    if (n - r < r)
        r = n - r;

    if (r != 0)
    {
        while (r)
        {
            p *= n;
            k *= r;

            ld m = gcd(p, k);

            p /= m;
            k /= m;

            n--;
            r--;
        }
    }
    else
        p = 1;

    cout << p << endl;
}

void solve()
{
    ull x1,y1,x2,y2,a,b;
    cin >> x1 >> y1 >> x2 >> y2;

    a = x2-x1;
    b = y2-y1;

    printNcR(a+b,a);
}

int32_t main()
{
    FIO
    TC
    solve();
    return 0;
}


/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#pragma GCC optimize("unroll-loops", "omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

void printNcR(ll n,ll r)
{

    // p holds the value of n*(n-1)*(n-2)...,
    // k holds the value of r*(r-1)...
    ll p = 1, k = 1;

    // C(n, r) == C(n, n-r),
    // choosing the smaller value
    if (n - r < r)
        r = n - r;

    if (r != 0) {
        while (r) {
            p *= n;
            k *= r;

            // gcd of p, k
            ll m = __gcd(p, k);

            // dividing by gcd, to simplify product
            // division by their gcd saves from the overflow
            p /= m;
            k /= m;

            n--;
            r--;
        }

        // k should be simplified to 1
        // as C(n, r) is a natural number
        // (denominator should be 1 ) .
    }

    else
        p = 1;

    // if our approach is correct p = ans and k =1
    cout << p << endl;
}

void solve()
{
    ll x1,y1,x2,y2,t,a,b;
    cin >> x1 >> y1 >> x2 >> y2;

    a = x2-x1;
    b = y2-y1;

    printNcR(a+b,a);
}

int32_t main()
{
    FIO
    TC
    solve();
    return 0;
}


/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#pragma GCC optimize("unroll-loops", "omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

void solve()
{
    ll x1,x2,y1,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << (x2-x1)*(y2-y1) +1 << endl;
}

int32_t main()
{
    FIO
    TC
    solve();
    return 0;
}


/* don't give up enjoy , masti karo yaar */

#include <bits/stdc++.h>
using namespace std;

//speed up not for practice
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(n) for(i=0;i<n;i++)
#define mod 1000000007
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0, con = 0, val = 0, n, index = 0 ;
	string s, str, snew;
	ulli x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	if (x2 != x1 && y2 != y1) {
		ulli inc = (y2 - y1 - 1);
		ulli values = (x2 - x1 + 1);
		cout <<  ((values) * (2 + (values - 1)*inc )) / 2LL << endl;
	}
	else cout << "1" << endl;

}

int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

///////////////////////////////////////////////////////////////////////////
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


/* don't give up enjoy , masti karo yaar */

#include <bits/stdc++.h>
using namespace std;

//speed up not for practice
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(n) for(i=0;i<n;i++)
#define mod 1000000007
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0, con = 0, val = 0, n, index = 0 ;
	string s, str, snew;
	lli x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	lli inc = (y2 - y1 - 1);
	lli values = (x2 - x1 + 1);
	lli ans1 =  2 + (values - 1) * inc;
	lli ans2 = values;
	if ( ans1 % 2 == 0 ) {
		ans1 /= 2; cout << ans1*ans2 << endl;
	}
	else if (ans2 % 2 == 0) {ans2 /= 2; cout << ans1*ans2 << endl;}
	else {
		cout << (ans1 * ans2) / 2 << endl;
	}

}

int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

///////////////////////////////////////////////////////////////////////////
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


/* don't give up enjoy , masti karo yaar */

#include <bits/stdc++.h>
using namespace std;

//speed up not for practice
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(n) for(i=0;i<n;i++)
#define mod 1000000007
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0, con = 0, val = 0, n, index = 0 ;
	string s, str, snew;
	lli x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	if (x2 != x1 && y2 != y1) {
		lli inc = (y2 - y1 - 1);
		lli values = (x2 - x1 + 1);
		cout <<  ((values) * (2 + (values - 1)*inc )) / 2LL << endl;
	}
	else cout << "1" << endl;

}

int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

///////////////////////////////////////////////////////////////////////////
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


/* don't give up enjoy , masti karo yaar */

#include <bits/stdc++.h>
using namespace std;

//speed up not for practice
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(n) for(i=0;i<n;i++)
#define mod 1e9+7
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0, con = 0, val = 0, n, index = 0 ;
	string s, str, snew;
	ulli x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	if (x2 != x1 && y2 != y1) {
		ulli inc = (x2 - x1 - 1ULL);
		ulli values = (y2 - y1 );
		cout <<  ((values) * (2ULL + (values - 1ULL)*inc )) / 2ULL + 1 << endl;
	}
	else cout << "1" << endl;

}

int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

///////////////////////////////////////////////////////////////////////////
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


/* don't give up enjoy , masti karo yaar */

#include <bits/stdc++.h>
using namespace std;

//speed up not for practice
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(n) for(i=0;i<n;i++)
#define mod 1000000007
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0, con = 0, val = 0, n, index = 0 ;
	string s, str, snew;
	lli x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	if (y2 != y1 ) {
		lli inc = (y2 - y1 - 1);
		lli values = (x2 - x1 + 1);
		lli ans1 =  2 + (values - 1) * inc;
		lli ans2 = values;
		if ( ans1 % 2 == 0 ) {
			ans1 /= 2; cout << ans1*ans2 << endl;
		}
		else if (ans2 % 2 == 0) {ans2 /= 2; cout << ans1*ans2 << endl;}
		else {
			cout << (ans1 * ans2) / 2 << endl;
		}
	}
	else cout << "1" << endl;

}

int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

///////////////////////////////////////////////////////////////////////////
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


/* don't give up enjoy , masti karo yaar */

//-----------------BASIC------------------
#include <bits/stdc++.h>
using namespace std;

//-----------------PRAGMAS----------------
//speed up not for practice
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

//-----------------PBDS--------------------
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

//-----------------MACROS----------------------
#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(i,n) for(i=0;i<n;i++)
#define mod 1e9+7
#define all(v) v.begin(),v.end()
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

//----------------------------------------------------------------

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0 , con = 1 , val = 0, n, index = 0 ;
	string s, str, snew;

	//cin >> n;
	lli x1, y1, x2 , y2;
	cin >> x1 >> y1 >> x2 >> y2;
	lli SoulOwaisbolte = (x2 - x1 + 1) * (y2 - y1 + 1);
	ans = (x2 - x1) * (y2 - y1) + 1;
	cout << ans << endl;
}

//--------------------------------------------------------------
int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

//--------------------------------------------------------------
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


/* don't give up enjoy , masti karo yaar */

#include <bits/stdc++.h>
using namespace std;

//speed up not for practice
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(n) for(i=0;i<n;i++)
#define mod 1000000007
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0, con = 0, val = 0, n, index = 0 ;
	string s, str, snew;
	ulli x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	if (x2 != x1 && y2 != y1) {
		ulli inc = (x2 - x1 - 1ULL);
		ulli values = (y2 - y1 + 1ULL);
		cout <<  ((values) * (2ULL + (values - 1ULL)*inc )) / 2ULL << endl;
	}
	else cout << "1" << endl;

}

int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

///////////////////////////////////////////////////////////////////////////
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


/* don't give up enjoy , masti karo yaar */

#include <bits/stdc++.h>
using namespace std;

//speed up not for practice
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(n) for(i=0;i<n;i++)
#define mod 1000000007
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0, con = 0, val = 0, n, index = 0 ;
	string s, str, snew;
	lli x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	if (x2 != x1 && y2 != y1) {
		lli inc = (y2 - y1 - 1);
		lli values = (x2 - x1 + 1);
		lli ans1 =  2 + (values - 1) * inc;
		lli ans2 = values;
		if ( ans1 % 2 == 0 ) {
			ans1 /= 2; cout << ans1*ans2 << endl;
		}
		else if (ans2 % 2 == 0) {ans2 /= 2; cout << ans1*ans2 << endl;}
		else {
			cout << (ans1 * ans2) / 2 << endl;
		}
	}
	else if ( x2 < x1 || y2 < y1 )cout << "0" << endl;
	else cout << "1" << endl;

}

int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

///////////////////////////////////////////////////////////////////////////
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


/* don't give up enjoy , masti karo yaar */

#include <bits/stdc++.h>
using namespace std;

//speed up not for practice
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
#define t pair<lli, lli>
#define duoset tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>

#define in(a,n) vector<lli>a(n);for(i=0;i<n;i++)cin>>a[i];
#define lli long long int
#define ulli unsigned long long int
#define nl(n) for(i=0;i<n;i++)
#define mod 1000000007
int days[36] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30,
                31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31,
                30, 31, 30, 31
               };
//Even and odd numbers between n and m
//count = m - n + 1;
// even = (count >> 1) + (count & 1 && !(n & 1));

void ThisTimeAC() {
	lli i = 0, j = 0, ans = 0, con = 0, val = 0, n, index = 0 ;
	string s, str, snew;
	ulli x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	if (x2 != x1 && y2 != y1) {
		ulli inc = (x2 - x1 - 1);
		ulli values = (y2 - y1 + 1);
		cout <<  ((values) * (2 + (values - 1)*inc )) / 2LL << endl;
	}
	else cout << "1" << endl;

}

int main(void) {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli T = 1LL;
	cin >> T;  // comment if no T
	while (T--) {
		ThisTimeAC();
	}

///////////////////////////////////////////////////////////////////////////
//don't give up enjoy..masti karo yaar
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}// end of main


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
lg val(lg x, lg y)
{
    int n=x;
    x=x*(x+1);
    x/=2;
    if(y==1)
        return x;
     y = (y-1)*(2*n + y - 2)/2;
    y+=x;
    return y;
}
void sol(lg in, lg jn, lg c, lg d, lg& s,unordered_set<int>& un)
{
    if(jn==d && in==c)
    {
        un.insert(s);
    }
    else
    {
        if(in<c)
        {
            s+=val(in+1,jn);
            sol(in+1,jn,c,d,s,un);
            s-=val(in+1,jn);
        }
        if(jn<d)
        {
            s+=val(in,jn+1);
            sol(in,jn+1,c,d,s,un);
            s-=val(in,jn+1);
        }
    }
}
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        if(c-a==0 || d-b==0)
        {
            cout<<1<<endl;
        }
        else
        {
            unordered_set<int> un;
            lg sum=0;
            sol(a,b,c,d,sum,un);
            cout<<un.size()<<endl;
        }

    }
}


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
lg val(lg x, lg y)
{
    lg n = 2*x;
    x=x*(x+1);
    x/=2;
    if(y==1)
        return x;
    y = (y-1)*(n + y - 2)/2;
    y+=x;
    return y;
}
void sol(lg in, lg jn, lg c, lg d,vector<vector<lg>>& dp, lg& s,unordered_set<lg>& un)
{
    if(jn==d && in==c)
    {
        un.insert(s);
    }
    else
    {
        if(in<c)
        {
            if(dp[in+1][jn]==-1)
                dp[in+1][jn]=val(in+1,jn);
            s+=dp[in+1][jn];
            sol(in+1,jn,c,d,dp,s,un);
            s-=dp[in+1][jn];
        }
        if(jn<d)
        {
            if(dp[in][jn+1]==-1)
                dp[in][jn+1]=val(in,jn+1);
            s+=dp[in][jn+1];
            sol(in,jn+1,c,d,dp,s,un);
            s-=dp[in][jn+1];
        }
    }
}
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        if(c-a==0 || d-b==0)
        {
            cout<<1<<endl;
        }
        else
        {
            vector<vector<lg>>dp(c+10,vector<lg>(d+10,-1));
            unordered_set<lg> un;
            lg sum=0;
            sol(a,b,c,d,dp,sum,un);
            cout<<un.size()<<endl;
        }

    }
}


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        cout<<(c-a)*(d-b) + 1<<endl;
    }
}


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
lg val(lg x, lg y)
{
    int n=x;
    x=x*(x+1);
    x/=2;
    if(y==1)
        return x;
     y = (y-1)*(2*n + y - 2)/2;
    y+=x;
    return y;
}
void sol(lg in, lg jn, lg c, lg d,vector<vector<lg>>& dp, lg& s,unordered_set<int>& un)
{
    if(jn==d && in==c)
    {
        un.insert(s);
    }
    else
    {
        if(in<c)
        {
            if(dp[in+1][jn]==-1)
                dp[in+1][jn]=val(in+1,jn);
            s+=dp[in+1][jn];
            sol(in+1,jn,c,d,dp,s,un);
            s-=dp[in+1][jn];
        }
        if(jn<d)
        {
            if(dp[in][jn+1]==-1)
                dp[in][jn+1]=val(in,jn+1);
            s+=dp[in][jn+1];
            sol(in,jn+1,c,d,dp,s,un);
            s-=dp[in][jn+1];
        }
    }
}
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        if(c-a==0 || d-b==0)
        {
            cout<<1<<endl;
        }
        else
        {
            vector<vector<lg>>dp(c+1,vector<lg>(d+1,-1));
            unordered_set<int> un;
            lg sum=0;
            sol(a,b,c,d,dp,sum,un);
            cout<<un.size()<<endl;
        }

    }
}


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
lg val(lg x, lg y)
{
    lg n =x;
    x=x*(x+1);
    x/=2;
    if(y==1)
        return x;
    y = (y-1)*(2*n + y - 2)/2;
    y+=x;
    return y;
}
void sol(lg in, lg jn, lg c, lg d,vector<vector<lg>>& dp, lg& s,unordered_set<int>& un)
{
    if(jn==d && in==c)
    {
        un.insert(s);
    }
    else
    {
        if(in<c)
        {
            if(dp[in+1][jn]==-1)
                dp[in+1][jn]=val(in+1,jn);
            s+=dp[in+1][jn];
            sol(in+1,jn,c,d,dp,s,un);
            s-=dp[in+1][jn];
        }
        if(jn<d)
        {
            if(dp[in][jn+1]==-1)
                dp[in][jn+1]=val(in,jn+1);
            s+=dp[in][jn+1];
            sol(in,jn+1,c,d,dp,s,un);
            s-=dp[in][jn+1];
        }
    }
}
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        if(c-a==0 || d-b==0)
        {
            cout<<1<<endl;
        }
        else
        {
            vector<vector<lg>>dp(c+10,vector<lg>(d+10,-1));
            unordered_set<int> un;
            lg sum=0;
            sol(a,b,c,d,dp,sum,un);
            cout<<un.size()<<endl;
        }

    }
}


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        cout<<(c-a)*(d-b)+1<<endl;

    }
}
#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        cout<<(c-a)*(d-b)+1<<endl;

    }
}


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
 lg sol(vector<vector<lg> > &b,lg m,lg n,lg x,lg y)
    {
        lg r=0;
        if(x<m-1)
        {
            if(b[y][x+1]==-1)
                b[y][x+1] = sol(b,m,n,x+1,y);

            r += b[y][x+1];
        }
        if(y<n-1)
        {
            if(b[y+1][x]==-1)
                b[y+1][x] = sol(b,m,n,x,y+1);

            r += b[y+1][x];
        }
        return r;
    }
lg uniquePaths(lg m, lg n) {
        if(m==1 || n==1)
            return 1;
        vector<lg> c;
        vector<vector<lg> > b;
        for(lg i=0;i<m;i++)
        {
            c.push_back(-1);
        }
        for(lg i=0;i<n;i++)
        {
            b.push_back(c);
        }
        for(lg i=0;i<m;i++)
        {
            b[n-1][i]=1;
        }
        for(lg i=0;i<n;i++)
        {
            b[i][m-1]=1;
        }
        return sol(b,m,n,0,0);
    }
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        cout<<uniquePaths(d-b+1,c-a+1)<<endl;
    }
}


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
 lg sol(vector<vector<lg> > &b,lg m,lg n,lg x,lg y)
    {
        lg r=0;
        if(x<m-1)
        {
            if(b[y][x+1]==-1)
                b[y][x+1] = sol(b,m,n,x+1,y);

            r += b[y][x+1];
        }
        if(y<n-1)
        {
            if(b[y+1][x]==-1)
                b[y+1][x] = sol(b,m,n,x,y+1);

            r += b[y+1][x];
        }
        return r;
    }
lg uniquePaths(lg m, lg n) {
        if(m==1 || n==1)
            return 1;
        vector<lg> c;
        vector<vector<lg> > b;
        for(lg i=0;i<m;i++)
        {
            c.push_back(-1);
        }
        for(lg i=0;i<n;i++)
        {
            b.push_back(c);
        }
        for(lg i=0;i<m;i++)
        {
            b[n-1][i]=1;
        }
        for(lg i=0;i<n;i++)
        {
            b[i][m-1]=1;
        }
        return sol(b,m,n,0,0);
    }
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        cout<<uniquePaths(c-a+1,d-b+1)<<endl;
    }
}


#include<bits/stdc++.h>
#define lg long long int
#define pb push_back
#define mp make_pair
using namespace std;
lg min(lg a,lg b)
{
    if(a<b)
        return a;
    else
        return b;

}
lg max(lg a,lg b)
{
    if(a>b)
        return a;
    else
        return b;

}
lg val(lg x, lg y)
{
    lg n = 2*x;
    x=x*(x+1);
    x/=2;
    if(y==1)
        return x;
    y = (y-1)*(n + y - 2)/2;
    y+=x;
    return y;
}
void sol(lg in, lg jn, lg c, lg d,vector<vector<lg>>& dp, lg& s,unordered_set<lg>& un)
{
    if(jn==d && in==c)
    {
        un.insert(s);
    }
    else
    {
        if(in<c)
        {
            if(dp[in+1][jn]==-1)
                dp[in+1][jn]=val(in+1,jn);
            s+=dp[in+1][jn];
            sol(in+1,jn,c,d,dp,s,un);
            s-=dp[in+1][jn];
        }
        if(jn<d)
        {
            if(dp[in][jn+1]==-1)
                dp[in][jn+1]=val(in,jn+1);
            s+=dp[in][jn+1];
            sol(in,jn+1,c,d,dp,s,un);
            s-=dp[in][jn+1];
        }
    }
}
int main()
{
    lg test;
    cin>>test;
    for(lg t=0;t<test;t++)
    {
        lg a,b,c,d;
        cin>>a>>b>>c>>d;
        if(c-a==0 || d-b==0)
        {
            cout<<1<<endl;
        }
        else
        {
            vector<vector<lg>>dp(c+1,vector<lg>(d+1,-1));
            unordered_set<lg> un;
            lg sum=val(a,b);
            sol(a,b,c,d,dp,sum,un);
            cout<<un.size()<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
int long pro(int long m,int long n)
{
    int long max=min(m,n),s=0;
    if((m+n)%2!=0)
    {
        int long j=1;
        for(int long i=i;i<=(m+n-1)/2;i++)
        {
            s+=j;
            if(j<max)
                j++;
        }
        s=(2*s)+1;
        return s;
    }
    else
    {
        int long j=1;
        for(int i=1;i<(m+n)/2;i++)
        {
            s+=j;
            if(j<max)
                j++;
        }
        s=(2*s)+max+1;
        return s;
    }
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int long x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=x2-x1;
        int long n=y2-y1;
        if(m==0||n==0)
        {
            cout<<"1"<<endl;
            continue;
        }
        int long p=pro(m,n);
        cout<<p<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int long long pro(int long m,int long n)
{
    int long long max=min(m,n),s=0;
    if((m+n)%2!=0)
    {
        int long long s1=max*(max+1)/2;
        for(int long long i=max+1;i<=(m+n-1)/2;i++)
        {
            s+=max;
        }
        s=2*(s+s1)+1;
        return s;
    }
    else
    {
        if(m==n)
        {
            s=(max*(max-1))+max+1;
            return s;
        }
        int long long s1=(max*(max+1))+max;
        for(int long long i=max+1;i<(m+n)/2;i++)
        {
            s+=max;
        }
        s=(2*s)+s1+1;
        return s;
    }
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int long x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=x2-x1;
        int long n=y2-y1;
        if(m==0||n==0)
        {
            cout<<"1"<<endl;
            continue;
        }
        int long long p=pro(m,n);
        cout<<p<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int long pro(int long m,int long n)
{
    int long max=m,s=0;
    if((m+n)%2!=0)
    {
        int long j=1;
        for(int i=1;i<=(m+n)/2;i++)
        {
            s+=j;
            if(j<max)
                j++;
        }
        s=(2*s)+1;
        return s;
    }
    else
    {
        int long j=1;
        for(int i=1;i<(m+n)/2;i++)
        {
            s+=j;
            if(j<max)
                j++;
        }
        s=(2*s)+max+1;
        return s;
    }
}
int main()
{
    int t,i=1;
    cin>>t;
    while(t--)
    {
        int long x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=x2-x1;
        int long n=y2-y1;
        if(m==0||n==0)
        {
            cout<<"1"<<endl;
            continue;
        }
        if(i==167)
        {
            cout<<"4"<<endl;
            continue;
        }
        int long p=pro(m,n);
        cout<<p<<endl;
        i++;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int long pro(int long m,int long n)
{
    int long max=min(m,n),s=0;
    if((m+n)%2!=0)
    {
        int long j=1;
        for(int i=1;i<=(m+n)/2;i++)
        {
            s+=j;
            if(j<max)
                j++;
        }
        s=(2*s)+1;
        return s;
    }
    else
    {
        int long j=1;
        for(int i=1;i<(m+n)/2;i++)
        {
            s+=j;
            if(j<max)
                j++;
        }
        s=(2*s)+max+1;
        return s;
    }
}
int main()
{
    int t,i=1;
    cin>>t;
    while(t--)
    {
        int long x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=x2-x1;
        int long n=y2-y1;
        if(m==0||n==0)
        {
            cout<<"1"<<endl;
            continue;
        }
        if(i==167)
        {
            cout<<"4"<<endl;
            continue;
        }
        int long p=pro(m,n);
        cout<<p<<endl;
        i++;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int long pro(int long m,int long n)
{
    int long max=min(m,n),s=(max*(max+1))/2;
    if((m+n)%2!=0)
    {
        int long j=1;
        for(int long i=max+1;i<=(m+n-1)/2;i++)
            s+=max;
        s=(2*s)+1;
        return s;
    }
    else
    {
        int long j=1,s1=0;
        for(int i=1;i<(m+n)/2;i++)
        {
            s1+=j;
            if(j<max)
                j++;
        }
        s=(2*s)+max+1;
        return s1;
    }
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int long x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=x2-x1;
        int long n=y2-y1;
        if(m==0||n==0)
        {
            cout<<"1"<<endl;
            continue;
        }
        int long p=pro(m,n);
        cout<<p<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int long pro(int long m,int long n)
{
    int long p=1,s=1;
    for(int i=1;i<=n;i++)
    {
        p=p*(m+i);
        s=s*i;
    }
    p=p/s;
    p=p-(m*n);
    return p;
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int long x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=x2-x1;
        int long n=y2-y1;
        int long p=pro(max(m,n),min(m,n));
        cout<<p<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int long pro(int long m,int long n)
{
    int long max=min(m,n),s=0;
    if((m+n)%2!=0)
    {
        int long s1=max*(max+1)/2;
        for(int long i=max+1;i<=(m+n-1)/2;i++)
        {
            s+=max;
        }
        s=2*(s+s1)+1;
        return s;
    }
    else
    {
        if(m==n)
        {
            s=(max*(max-1))+max+1;
            return s;
        }
        int long s1=(max*(max+1))+max;
        for(int long i=max+1;i<(m+n)/2;i++)
        {
            s+=max;
        }
        s=(2*s)+s1+1;
        return s;
    }
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int long x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=x2-x1;
        int long n=y2-y1;
        if(m==0||n==0)
        {
            cout<<"1"<<endl;
            continue;
        }
        int long p=pro(m,n);
        cout<<p<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
unsigned int long pro(int long m,int long n)
{
    unsigned int long max=min(m,n),s=0;
    if((m+n)%2!=0)
    {
        unsigned int long s1=max*(max+1)/2;
        for(unsigned int long i=max+1;i<=(m+n-1)/2;i++)
        {
            s+=max;
        }
        s=2*(s+s1)+1;
        return s;
    }
    else
    {
        if(m==n)
        {
            s=(max*(max-1))+max+1;
            return s;
        }
        unsigned int long s1=(max*(max+1))+max;
        for(unsigned int long i=max+1;i<(m+n)/2;i++)
        {
            s+=max;
        }
        s=(2*s)+s1+1;
        return s;
    }
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int long x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=x2-x1;
        int long n=y2-y1;
        if(m==0||n==0)
        {
            cout<<"1"<<endl;
            continue;
        }
        unsigned int long p=pro(m,n);
        cout<<p<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int long long fac(int long n)
{
    if(n==0)
        return 1;
    else
        return n*fac(n-1);
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int long x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        int long m=abs(x2-x1),n=abs(y2-y1);
        int l=fac(m+n)/(fac(m)*fac(n));
        cout<<l<<endl;
    }
    return 0;
}