#include <iostream>
#include <cmath>

using namespace std;

struct POINT
{
    int X;
    int Y;

    POINT(int _X, int _Y)
    {
        X = _X;
        Y = _Y;
    }

    POINT()
    {
        X = 0;
        Y = 0;
    }

    void Enter()
    {
        cin >> X;
        cin >> Y;
    }
};

int P(int A, int B)
{
    return max(B - A + 1, 0);
}

int Answer(POINT P1, POINT P2, int A, int B)
{
    int AbsX = abs(P1.X - P2.X);
    int AbsY = abs(P1.Y - P2.Y);

    return P(AbsX, A) * P(AbsY, B);
}

int main()
{
    int N;
    cin >> N;

    for (int i = 0; i < N; i++)
    {
        POINT P1;
        POINT P2;

        int A;
        int B;

        P1.Enter();
        P2.Enter();

        cin >> A;
        cin >> B;

        cout << Answer(P1, P2, A, B) << endl;
    }
}
