#include<iostream>
using namespace std;

int main()
{
    int T;

    cin >> T;

    for(int i = 0; i < T; i++)
    {
        int x1, y1, x2, y2;
        int a, b;
        int br = 0;

        cin >> x1 >> y1;
        cin >> x2 >> y2;
        cin >> a >> b;

        for(int x = 0; x <= a; x++)
        {
            for(int y = 0; y <= b; y++)
            {
                int xx, yy;

                xx = x2 - (x1 - x);
                yy = y2 - (y1 - y);

                if( ((xx >= 0) && (xx <= a)) && ((yy >= 0) && (yy <= b)) )
                {
                    //cout << x << " " << y << " " << xx << " " << yy << endl;
                    br++;
                }
            }
        }

        cout << br << endl;
    }

    return 0;
}

