#include<iostream>
using namespace std;
long long f(long long x1, long long y1, long long x2, long long y2, long long a, long long b){
    long long l, h;
    l = abs(x2 - x1);
    h = abs(y2 - y1);
    long long a1, b1;
    a1 = a - l + 1;
    b1 = b - h + 1;
    if(a1 * b1 <= 0)return 0;
    return a1 * b1;
}
int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long x1, x2, y1, y2, a, b, q;
    cin >> q;
    for(long long i = 0; i < q; i++){
        cin >> x1 >> y1 >> x2 >> y2 >> a >> b;
        cout << f(x1, y1, x2, y2, a, b) << endl;;
    }

    return 0;
}
