#include<bits/stdc++.h>
using namespace std;



void komb(long long x1,long long y1, long long x2,long long y2,long long a, long long b){
    long long x=abs(x1-x2);
    long long y=abs(y1-y2);
    //cout<<x<<y<<endl;
    x=abs(a)-x;
    y=abs(b)-y;
    //cout<<x<<y<<endl;
    if(x<0 || y<0){
        cout<<0<<endl;
        return;
    }
    cout<<(x+1)*(y+1)<<endl;
}

long long n,g1,h1,g2,h2,a1,b1;

int main (){

ios::sync_with_stdio(false);
cin.tie(NULL);
cin>>n;
for(long long i=0;i<n;i++){
    cin>>g1>>h1>>g2>>h2>>a1>>b1;
    komb(g1,h1,g2,h2,a1,b1);
}

return 0;

}
