#include<iostream>
#define ll long long
using namespace std;
ll f(int x1, int y1, int x2, int y2, int a, int b){
    int l, h;
    l = abs(x2 - x1);
    h = abs(y2 - y1);
    int 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);
    int x1, x2, y1, y2, a, b, q;
    cin >> q;
    for(int i = 0; i < q; i++){
        cin >> x1 >> y1 >> x2 >> y2 >> a >> b;
        cout << f(x1, y1, x2, y2, a, b) << endl;;
    }

    return 0;
}
