#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main ()
{
    long long T;
    cin>>T;
    for(int i=0;i<T;i++)
    {
        long long x, y, x1, y1, a, b, otg=0;
        long long duljina, duljina2;
        cin>>x>>y>>x1>>y1>>a>>b;
        duljina=abs(x-x1);
        duljina2=abs(y-y1);
        ///cout<<duljina<<" "<<duljina2;
        for(long long i=0;i<=a;i++)
        {
            for(long long j=0;j<=b;j++)
            {
                if(i+duljina<=a)
                {
                    if(j+duljina2<=b)
                    {
                        ///cout<<i<<" "<<j<<" "<<i+duljina<<" "<<j+duljina2<<endl;
                        otg++;
                    }
                }
            }
        }
        cout<<otg<<endl;
    }

    return 0;
}
