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



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

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

int main (){

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

return 0;

}
