#include <bits/stdc++.h>
using namespace std;
int sign(int n){
    if(n==0){return 0;}
    int s = (n >> 31);
    if(s==0){s++;}
    return s;
}
int solve(int x1, int y1, int x2, int y2, int a, int b){
//    cout << "(" << x1 << ", " << y1 << ") -> (" << x2 << ", " << y2 << ");  a=" << a << "; b=" << b << '\n';
    int xoff = abs(x2 - x1);
    int yoff = abs(y2 - y1);
//    cout << "[" << xoff << ", " << yoff << "]\n";

    a = abs(a)+1;
    b = abs(b)+1;

//    cout << '\t' << (a*b) << '\n';
//    cout << '\t' << -(xoff*yoff) << '\n';
//    cout << '\t' << -abs(xoff * (b - yoff)) << '\n';
//    cout << '\t' << -abs(yoff * (a - xoff)) << '\n';
    int res = a*b - xoff*yoff - abs(xoff * (b - yoff)) - abs(yoff * (a - xoff));
    if(res <= 0){return 0;}
    return res;

//    int x_bnd_upper = max(a, 0);
//    int x_bnd_lower = min(a, 0);
//    int y_bnd_upper = max(b, 0);
//    int y_bnd_lower = min(b, 0);
//
//
//
//    int cnt = 0;
//    int x, y;
//    for(int i = 0; i <= x_bnd_upper; i++){
//        for(int j = 0; j <= y_bnd_upper; j++){
//            x = i+xoff;
//            y = j+yoff;
//            if(sign(x) == sign(x-x_bnd_upper)){continue;}
//            if(sign(y) == sign(y-y_bnd_upper)){continue;}
//            cnt++;
//        }
//    }
//    return cnt;
}
int main(){
    cin.sync_with_stdio(0);
    cin.tie(nullptr);
    int t;
    cin >> t;
    int x1, y1;
    int x2, y2;
    int a, b;
    vector<int> results;
    for(int i = 0; i < t; i++){
        cin >> x1 >> y1;
        cin >> x2 >> y2;
        cin >> a >> b;
        if(a == 0 || b == 0){cout << "0"; continue;}
        results.push_back(solve(x1, y1, x2, y2, a, b));
    }
    for(int i = 0; i < t; i++){
        cout << results[i];
        if(i + 1 != t){cout << '\n';}
    }
    return 0;
}
