#include <bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    int T,x1,x2,y1,y2,a,b,U=0,R=0,komb;
    cin>>T;
    for(int i=0;i<T;i++){
        cin>>x1>>y1>>x2>>y2>>a>>b;
        komb=0;
        if((x1>=0 && x2>=0)&&(x1<=a&&x2<=a)){
            if((y1>=0 && y2>=0)&&(y1<=b&&y2<=b)){
                komb=-1;
            }
        }
        R=abs(x2-x1);
        U=abs(y2-y1);
        if(R>a){
            cout<<0;
            continue;
        }
        if(U>b){
            cout<<0;
            continue;
        }
        komb+=(a-R+1)*(b-U+1);
        cout<<komb<<endl;
    }





    return 0;
}
