#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)+abs(x1);
        duljina2=abs(y)+abs(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)
                    {
                        otg++;
                    }
                    if(j-duljina2>=0)
                    {
                        otg++;
                    }
                }
                if(i-duljina>=0)
                {
                    if(j+duljina2<=b)
                    {
                        otg++;
                    }
                    if(j-duljina2>=0)
                    {
                        otg++;
                    }
                }
                if(j+duljina<=b)
                {
                    if(i+duljina2<=a)
                    {
                        otg++;
                    }
                    if(i-duljina2>=0)
                    {
                        otg++;
                    }
                }
                if(j-duljina>=0)
                {
                    if(i+duljina2<=a)
                    {
                        otg++;
                    }
                    if(i-duljina2>=0)
                    {
                        otg++;
                    }
                }
            }
        }
        cout<<otg<<endl;
    }

    return 0;
}
