#include <bits/stdc++.h>
using namespace std;
int solve(int x1, int y1, int x2, int y2, int a, int b){
    int xoff = x2 - x1;
    int yoff = y2 - y1;
    int cnt = 0;
    for(int x = 0; x <= a; x++){
        for(int y = 0; y <= b; y++){
            if((x+xoff <= a) && (x+xoff >= 0) && (y+yoff <= b) && (y+yoff >= 0)){
                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;
        results.push_back(solve(x1, y1, x2, y2, a, b));
    }
    for(int i = 0; i < t; i++){
        cout << results[i] << '\n';
    }
    return 0;
}
